Zum Hauptinhalt wechseln
Adaptive Planning
importConfigurableModelData

importConfigurableModelData

Updated in API v40 (September 21, 2024).
Category
Data submission
Description
Inserts, replaces, or updates data in a modeled sheet.
Permissions Required To Invoke
Import
Parameters Required On Request
Credentials, ImportDataOptions, Version, Sheet, RowData
This method's request contains the parameters that will be used to determine which sheet and which version will receive the supplied rows of data.
This method can:
  • Append new rows onto the sheet.
  • Replace all rows currently on the modeled sheet with the import.
  • Replace all data in the sheet, but only for imported levels
  • Update existing rows by matching rows from the import with an import key.
  • Update existing rows by matching rows from the import with an import key, and add new rows.
Each invocation of this API call must contain exactly one element of each of the listed types:
  • credentials
  • importDataOptions
  • version
    • sheet
    • rowData
A mismatch between the number of pipe characters ( | ) in the header and the data will cause an error for API v30 or higher.
As of API v37, we limit the maximum number of new rows you can import into modeled sheets. Contact support if you encounter this limit.

Request Format

<?xml version='1.0' encoding='UTF-8'?> <call method="importConfigurableModelData" callerName="a string that identifies your client application"> <credentials login="sampleuser@company.com" password="my_pwd" instanceCode="INSTANCE1"/> <importDataOptions planOrActuals="Plan" allowParallel="false" moveBPtr="false" useMappings="false" replaceExisting="2"/> <version name="Budget 2014" isDefault="false" /> <sheet name="Personnel" isUserAssigned="false" /> <rowData> <header>Level|Region|Title|JobCode|Benefits|per|Last Name|First Name|ID|Start|End|Hr/Week|Pay Rate|Pay Rate Display Column</header> <rows> <row>Corporate Plan|Any|CEO|E1|Yes|Yr|Topdog|Andy|1000|12/20/2013|12/30/2014|80|500,000.12|888,888</row> </rows> </rowData> </call>

Request Format for Updating Existing Rows with importKey

<?xml version='1.0' encoding='UTF-8'?> <call method="importConfigurableModelData" callerName="a string that identifies your client application"> <credentials login="sampleuser@company.com" password="my_pwd"instanceCode="INSTANCE1"/> <importDataOptions planOrActuals="Plan" replaceExisting="3" importKey="Region" allowParallel="false" moveBPtr="false" useMappings="false"/> <version name="Budget 2014" isDefault="false" /> <sheet name="Personnel" isUserAssigned="false" /> <rowData> <header>Plan|Region|Benefits|per</header> <rows> <row>Europe Sales|W-US|Yes|Hr</row> </rows> </rowData> </call>
credentials element
Tag Name
credentials
Description
All API calls must contain a singlecredentials element to identify the user invoking the API. The API call is then performed as this user (any audit trail or history of actions in the system will show that this user performed the action), and therefore the user must have the required permissions to perform the action in order for the API call to succeed.
Attributes of the Element
Attribute Name
Required?
Value
Example
login
Y
The login name of the user invoking the API method. This user must have the required permissions to invoke the method.
sampleuser@company.com
password
Y
The password of the user invoking the API method.
my_password
locale
N
Specify the locale to be used to interpret incoming numbers and dates, and to format outgoing numbers and dates (using the proper thousands separator, time period names, and date formatting). The locale is also used to specify the language in which any system messages in the response should appear. If not specified, en_US (American English) is used.
fr_FR
instanceCode
N
If the user specified in the credentials has access to more than one instance of
Adaptive Planning
, this attribute can be used to specify that the user is intending to access an instance other than their default instance. If not specified, the user's default instance will be used. To determine the available instance codes, use the exportInstances API.
MYINSTANCE1
Contents of the Element
(none)
importDataOptions element
Tag Name
importDataOptions
Description
Specifies the options to be used when performing the import.
Attributes of the Element
Attribute Name
Required?
Value
Example
planOrActuals
Y
Set to one ofPlan orActuals to specify the type of data being imported. If this setting is in conflict with the version specified in the Version tag, the Version tag's value takes precedence and this setting is ignored.
Plan
moveBPtr
N
Used only when the data being imported has a set of timespan numbers of each row. IfmoveBPtr is set totrue, the import will move the actuals availability pointer in the actuals version to be the latest time period found in the imported data. If set tofalse, the import will not affect which time periods show actuals on any version. This attribute must be set to false if planOrActuals is set to Plan.
false
allowParallel
Y
If set totrue, then an import will proceed even if there is already another actuals or transactions import in process for this instance. If set tofalse, then an attempt to import will fail if there is already an actuals or transactions import being processed for this instance.
false
useMappings
N
Specifies whether to use import mappings for accounts, plans and dimension values inside the row elements. Consideredtrue by default. Iffalse then the internal identifiers should be used: accounts are identified by code, levels and dimension values by name.
false
replaceExisting
N
Set to "1" or "true" to replace all existing rows on all levels with the new rows being imported (i.e. erase all previously existing rows on all levels). Only users with the
Import to All Locations
permission can use this option.
Set to "0" or "false" to append the imported rows to the existing rows, even if the new rows are duplicates.
Set to "2" to replace the existing rows in the modeled sheet with the new rows being imported, but only for rows with matching level and secured dimensions. Rows of level and secured dimensions combinations which do not have any unsplit rows in the uploaded spreadsheet will not have their existing rows removed, unless the row was a split of a row that is being replaced by the upload.
replaceExisting examines the used dimensions, and if data exists in the same level, account, time period, and version. If a row key exists, we match to the row key column or columns, as well.
If data exists in the system at the same location, the import replaces it. This replacement occurs row by row. The import does not replace everything at once. Unmatched import rows append to the sheet.
For example, you perform two imports. Your first import file loads data that your second import file does not contain. That existing data will remain after the second import.
If you want to delete all of the data in a particular column, include the column but leave its column values blank. Column values for unmentioned columns remain unaltered.
Set to "3" to update existing rows in the modeled sheet to reflect the new rows being imported. A warning will be returned if any row does not match an existing row. This mode requires an importKey. Sheets with
Allow splits
selected do not support updates.
Set to "4" to update existing rows in the modeled sheet to reflect the new rows being imported, and insert new rows for any which do not match an existing row. This mode requires an importKey. Only required columns are Import Key, Level, and any text selectors, even when not adding new rows. Sheets with
Allow splits
selected do not support updates.
Set to 5 to replace existing rows based on scope which currently only supports input levels for the replace by level only functionality. The scope is provided using a new scope element. Only the rows that match the given scope will be replaced by the payload in the import. Rows that do not match the scope will remain unaffected.
Default value is true.
true
importKey
N
The modeled sheet column name to use as the import key when updating modeled sheet rows.
Adaptive Planning
uses the import key column to match each row in the import to rows in the modeled sheet. The import key value of every row must be unique.
This attribute can only be used when replaceExisting is "3" or "4".
Import key columns can be one of the following:
  • a level column
  • a dimension column
Level
includeContext
N
Specifies whether messages may include the context block. Values arefalse (never show context) ortrue (show context if appropriate). If not specified,true is assumed.
false
displayNameEnabled
Only available in API v31+ for instances that enable display name.
N
displayNameEnabled=true indicates API should expect Account Code, Level Code, Dimension Code and Dimension Name column in the payload when the Enable Display Name setting is ON for the instance.
displayNameEnabled=false indicates API should continue following pre- v30 API contract even when the Enable Display Name setting is ON for the instance.
The default value for displayNameEnabled is "false".
false
applyValidationRules
Only available in API v38 +.
N
applyValidationRules=true indicates API will perform modeled sheet rule validations for all imported data when API version is greater than equal to v38.
applyValidationRules=false indicates API will ignore modeled sheet rule validations for all imported data.
The default value for applyValidationRules is "true".
false
Contents of the Element
(none)
version element
Tag Name
version
Description
Indicates which version should be used to receive the requested data. A version must be provided for each call.
Attributes of the Element
Attribute Name
Required?
Value
Example
name
N
The name of the version to be used to receive the data. Only one version can be accessed within a single API call. If a name is not provided, theisDefault flag must be set totrue on this element.
Budget 2014
isDefault
N
If the caller wishes to access the current default version of the instance regardless of its name, this attribute can be set to true, in which case the name attribute of the tag (if present) is ignored. Otherwise, if this value is false or if this attribute is not present, a version with the supplied name must exist and be accessible to the user in order for this call to succeed.
false
Contents of the Element
(none)
sheet element
Tag Name
sheet
Description
Indicates which sheet should receive the imported data. Each API call can target only one sheet's data.
Attributes of the Element
Attribute Name
Required?
Value
Example
name
Y
The name of the sheet to which the data will be imported.
Personnel
isUserAssigned
N
Indicates the sheet is a user-assigned sheet. If not specified, defaults to false, which indicates it's a level-assigned sheet.
false
Contents of the Element
(none)
Scope element
Tag Name
Scope (available with API v40)
Description
Specifies the scope for this import. Example:
<scope> <levels> mode="INPUT"/> </scope>
Only allowed when the replaceExisting attribute of importDataOptions element is 5.
rowData element
Tag Name
rowData
Description
Container for the rows of data being imported.
Attributes of the Element
(none)
Contents of the Element
Exactly oneheader element and exactly onerows element.
header element
Tag Name
header
Description
Specifies the names and order of the columns of the data in the correspondingrows element.
Attributes of the Element
(none)
Contents of the Element
A line of text with vertical-bar-separated column names. These column names must correspond to the names of the dimensions or fields on the sheet, or to the codes of the time periods that can contain data. They are identical to the column names found in the Import Template for the sheet to which the data is being imported, with each column header separated from the next by a vertical bar or pipe symbol | .
For instances that enable Display Name, the header doesn't support
"<dimension>"
in combination with
"<dimension> Name"
or
"<dimension> Code"
in API v30 or higher for Adaptive Planning supported locales.
rows element
Tag Name
rows
Description
Container for one or morerow elements.
Attributes of the Element
(none)
Contents of the Element
One or morerow elements.
row element
Tag Name
row
Description
Data for a single row being imported.
Attributes of the Element
(none)
Contents of the Element
Data for the fields in a single row being imported, each field's value separated by a vertical bar or pipe symbol. The data fields must be in the same order as the line in the header element. If numbers in the values use thousands separators, they are assumed to be the comma separators used in the locale specified in the credentials of the request.

Response Format

These are examples of responses for successful and unsuccessful importing of data.

Success Example

<?xml version='1.0' encoding='UTF-8'?> <response success="true"> <messages> <message key="modeled-import-success">Personnel import successful. Rows imported: 1</message> <message key="modeled-import-replace">All existing rows were replaced.</message> </messages> </response>

Failed (with context)

<?xml version='1.0' encoding='UTF-8'?> <response success="false"> <messages> <message key="modeled-import-failed">The Personnel import has failed.</message> <message key="error-import">Import Failed with the following error: 1 Error(s) Occurred.</message> <message key="import-detail">Additional information:</message> <message key="warning-nonexistent-dimension-value">Warning: No data was imported for rows with the following dimension values because the dimension values for Plan do not exist: Development1.</message> <message key="invalid-plan-choice-withCoordinate"> <context> <col header="Plan" value="Development1" /> <col header="Region" value="C-US" /> <col header="Title" value="CEO" /> <col header="JobCode" value="E1" /> <col header="Benefits" value="Yes" /> <col header="per" value="Yr" /> <col header="Last Name" value="Topdog" /> <col header="First Name" value="Andy" /> <col header="ID" value="1000" /> <col header="Start" value="12/20/2013" /> <col header="End" value="12/30/2014" /> <col header="Hr/Week" value="80.0" /> <col header="Pay Rate" value="500000.12" /> <col header="Pay Rate Display Column" value="888,888" /> </context> Invalid Level Choice: Development1 on row 1 column A </message> </messages> </response>

Failed (no context)

<?xml version='1.0' encoding='UTF-8'?> <response success="false"> <messages> <message key="modeled-import-failed">The Personnel import has failed.</message> <message key="error-import">Import Failed with the following error: 1 Error(s) Occurred.</message> <message key="import-detail">Additional information:</message> <message key="warning-nonexistent-dimension-value">Warning: No data was imported for rows with the following dimension values because the dimension values for Plan do not exist: Development1.</message> <message key="invalid-plan-choice-withCoordinate">Invalid Level Choice: Development1 on row 1 column A</message> </messages> </response>
response element
Tag Name
response
Attributes of the Element
Attribute Name
Required?
Value
Example
success
Y
Eithertrue orfalse, indicating whether the API call was successful or not. Even successful calls may contain warning messages in their response.
true
Contents of the Element
A single optionalmessages element.
messages element
Tag Name
messages
Description
Container for one or moremessage elements.
Attributes of the Element
(none)
Contents of the Element
One or moremessage elements.
message element
Tag Name
message
Description
Represents a message being sent from the system back to the caller. Messages are used for error messages when requests do not succeed, for warning messages when requests do succeed, and for confirmation messages upon success.
Attributes of the Element
Attribute Name
Required?
Value
Example
key
N
When given, a key is a way to identify a particular message or type of message, useful for purposes of automated error logging and recovery in client programs. Keys do not change under different locales of requests, even when the language of the message changes. Keys also are unlikely to change in the future due to wording adjustments or terminology changes.
invalid-attributevalueid
Contents of the Element
  1. The text of the message. This text is in the language of the locale specified on the request (assuming that locale is supported). The text may also contain variable information such as the number of rows which were processed, or the particular column or value that caused an error.
  2. An optional context element.
context element
Tag Name
context
Description
Container for one or more col elements.
Attributes of the Element
Attribute Name
Required?
Value
Example
none
Contents of the Element
One or more col elements.
col element
Tag Name
col
Description
Represents the context for the message. Gives a header/value pair so the row generating the message can be identified.
Attributes of the Element
Attribute Name
Required?
Value
Example
header
Y
The header of the column.
"Account"
value
Y
The value in the column.
"GL-29482-38233"
Contents of the Element
(none)