Anaplan Connect 1.4.3
Hi,
Is there a way to configure the format of the dump file from tab delimited to comma separated values?
In addition, is there any documentation that has a list of all the error messages that can occur within the application? I looked on the Anaplan Connect guide and whilst there is a small "troubleshoot" area, it seems strange that there isn't a list of all error messages that can be returned.
Finally, if the Anaplan service could not be reached when a script in Anaplan Connect is run, does anyone know if/what error message is dumped (not sure if it is dumped as no action would have been performed)?
Many thanks,
Callum
Answers
-
the error messages varies based on the "task" executed (Task is Import/Export/Process/Action).
For example: there are several errors an Import can trigger (will look thru my code and share a few examples). We have the same questions and basically resorted to triggering different type of import failures to see the various error messages.
You can see a few examples here as well : https://anaplanbulkapi20.docs.apiary.io/#reference/import
(see below).
On your second Q, here are the common HTTP codes for REST API https://www.restapitutorial.com/httpstatuscodes.html
(Anaplan Connect is essentially a prepackaged, full implementation of the REST APIs so the error messages are common...look for the errors in the application log)
Response 200 (application/json)
Body
{
"currentStep":"Complete.",
"progress":1.0,
"result":{
"failureDumpAvailable":false,
"objectId":"112000000011",
"successful":true
},
"taskId":"7D33C19584CB4130A673474BB0206D36",
"taskState":"COMPLETE"
}
{
"currentStep":"Complete.",
"progress":1.0,
"result":{
"details":[
{
"localMessageText":"Close Date cells: 0 (1 failed)",
"occurrences":0,
"type":"lineItemRowsProcessedWithFailures",
"values":[
"lineItemName",
"Close Date",
"failureCount",
"1",
"rowCount",
"0"
]
},
{
"localMessageText":"Invalid line item identifier",
"occurrences":85708,
"type":"moduleImportInvalidLineItemIdentifier",
"values":[
"value",
"Column 3 (\"Won\")"
]
},
{
"localMessageText":"Invalid version",
"occurrences":7,
"type":"moduleImportInvalidVersion",
"values":[
"value",
"Versions"
]
}
],
"failureDumpAvailable":true,
"objectId":"112000000011",
"objectName":"Failures for Import 11",
"successful":true
},
"taskId":"7D33C19584CB4130A673474BB0206D36",
"taskState":"COMPLETE"
}
1 -
Many thanks @damianshameer2 for the useful links!
0 -
Imports from a file should use the same format/layout as the source when producing the dump file. I think Anaplan Connect only supports tab-separated UTF-8 text for JDBC sourced uploads.
Imports from another model don't have this information so use a fixed dump file format: UTF-8 encoding, comma-separated values delimited by double quotes, first row is header row, second row is start of data.
That's what I remember anyway; let me know if I'm wrong.1 -
The output below is from a small POC i did a few months back while testing file upload...since then expanded to test imports, exports, processes, action to build out our APIs
you can find the set up here: https://community.anaplan.com/t5/Anaplan-Platform-Discussions/Uploading-file-Via-REST-API-and-Triggering-Imports/td-p/51791
For this test, I uploaded the file to Anaplan and start the import. Note that target list is empty
- Start Import API URL
<a href="<a href="https://api.anaplan.com/2/0/workspaces/xxxxx/models/xxxx/imports/112000000043/tasks" target="_blank">https://api.anaplan.com/2/0/workspaces/xxxxx/models/xxxx/imports/112000000043/tasks</a>" target="_blank"><a href="https://api.anaplan.com/2/0/workspaces/xxxxx/models/xxxx/imports/112000000043/tasks</a" target="_blank">https://api.anaplan.com/2/0/workspaces/xxxxx/models/xxxx/imports/112000000043/tasks</a</a>>
JSON Response:
Note task State is IN PROGRESS.
resultStr: { "meta" : { "schema" : "<a href="<a href="https://api.anaplan.com/2/0/models/xxxxx/objects/task" target="_blank">https://api.anaplan.com/2/0/models/xxxxx/objects/task</a>" target="_blank"><a href="https://api.anaplan.com/2/0/models/xxxxx/objects/task</a" target="_blank">https://api.anaplan.com/2/0/models/xxxxx/objects/task</a</a>>" }, "status" : { "code" : 200, "message" : "Success" }, "task" : { "taskId" : "7F6563293E554BA29C11391B04074D10", "taskState" : "IN_PROGRESS", "creationTime" : 1575052919025 } } { "meta" : { "schema" : "<a href="<a href="https://api.anaplan.com/2/0/models/xxxxx/objects/task" target="_blank">https://api.anaplan.com/2/0/models/xxxxx/objects/task</a>" target="_blank"><a href="https://api.anaplan.com/2/0/models/xxxxx/objects/task</a" target="_blank">https://api.anaplan.com/2/0/models/xxxxx/objects/task</a</a>>" }, "status" : { "code" : 200, "message" : "Success" }, "task" : { "taskId" : "7F6563293E554BA29C11391B04074D10", "taskState" : "IN_PROGRESS", "creationTime" : 1575052919025 } }
2. Check status om Import. Large data files will obviously take a while to process so you have to keep checking if the Import is done....Anaplan Connect does this already. Below is the pure REST example
URL: to execute: <a href="<a href="https://api.anaplan.com/2/0/workspaces/8a81b01xxxxx/models/xxxxxxxx/imports/112000000043/tasks/7F6563293E554BA29C11391B04074D10" target="_blank">https://api.anaplan.com/2/0/workspaces/8a81b01xxxxx/models/xxxxxxxx/imports/112000000043/tasks/7F6563293E554BA29C11391B04074D10</a>" target="_blank"><a href="https://api.anaplan.com/2/0/workspaces/8a81b01xxxxx/models/xxxxxxxx/imports/112000000043/tasks/7F6563293E554BA29C11391B04074D10</a" target="_blank">https://api.anaplan.com/2/0/workspaces/8a81b01xxxxx/models/xxxxxxxx/imports/112000000043/tasks/7F6563293E554BA29C11391B04074D10</a</a>>
JSON Response. Note Progress is still 0.0%
[executeGetApi] responseCode: 200 { "meta" : { "schema" : "<a href="<a href="https://api.anaplan.com/2/0/models/4F4E190CF08D4933BAD04DC452467CF6/objects/task" target="_blank">https://api.anaplan.com/2/0/models/4F4E190CF08D4933BAD04DC452467CF6/objects/task</a>" target="_blank"><a href="https://api.anaplan.com/2/0/models/4F4E190CF08D4933BAD04DC452467CF6/objects/task</a" target="_blank">https://api.anaplan.com/2/0/models/4F4E190CF08D4933BAD04DC452467CF6/objects/task</a</a>>" }, "status" : { "code" : 200, "message" : "Success" }, "task" : { "taskId" : "7F6563293E554BA29C11391B04074D10", "currentStep" : "Retrieving data from Activity_log_20191029_v1.txt", "progress" : 0.0, "taskState" : "IN_PROGRESS", "creationTime" : 1575052919025 } }
3. Task complete. Final Response
Note taskStatus is COMPLETE (see ' ==> here' comment)
"localMessageText" : "Activity Log: 25 (25/0) rows successful, 0 ignored " --> all rows inserted no issues
URL: to execute: <a href="<a href="https://api.anaplan.com/2/0/workspaces/xxxx/models/xxxxx/imports/112000000049/tasks/7F6563293E554BA29C11391B04074D10" target="_blank">https://api.anaplan.com/2/0/workspaces/xxxx/models/xxxxx/imports/112000000049/tasks/7F6563293E554BA29C11391B04074D10</a>" target="_blank"><a href="https://api.anaplan.com/2/0/workspaces/xxxx/models/xxxxx/imports/112000000049/tasks/7F6563293E554BA29C11391B04074D10</a" target="_blank">https://api.anaplan.com/2/0/workspaces/xxxx/models/xxxxx/imports/112000000049/tasks/7F6563293E554BA29C11391B04074D10</a</a>> [executeGetApi] responseCode: 200 { "meta" : { "schema" : "<a href="<a href="https://api.anaplan.com/2/0/models/4F4E190CF08D4933BAD04DC452467CF6/objects/task" target="_blank">https://api.anaplan.com/2/0/models/4F4E190CF08D4933BAD04DC452467CF6/objects/task</a>" target="_blank"><a href="https://api.anaplan.com/2/0/models/4F4E190CF08D4933BAD04DC452467CF6/objects/task</a" target="_blank">https://api.anaplan.com/2/0/models/4F4E190CF08D4933BAD04DC452467CF6/objects/task</a</a>>" }, "status" : { "code" : 200, "message" : "Success" }, "task" : { "taskId" : "7F6563293E554BA29C11391B04074D10", "currentStep" : "Complete.", "progress" : 1.0, "result" : { "details" : [ { "localMessageText" : "Activity Log: 25 (25/0) rows successful, 0 ignored ", "occurrences" : 0, "type" : "hierarchyRowsProcessed", "values" : [ "hierarchyName", "Activity Log", "successRowCount", "25", "successCreateCount", "25", "successUpdateCount", "0", "warningsRowCount", "0", "warningsCreateCount", "0", "warningsUpdateCount", "0", "failedCount", "0", "ignoredCount", "0", "totalRowCount", "25", "totalCreateCount", "25", "totalUpdateCount", "0", "invalidCount", "0", "updatedCount", "0", "renamedCount", "0", "createdCount", "25" ] } ], "failureDumpAvailable" : false, "objectId" : "112000000049", "successful" : true ==> here }, "taskState" : "COMPLETE", ==> here "creationTime" : 1575054105897 } }
4. Now lets run the same import again to trigger some warnings
Status is this COMPLETE but look at localize message
"localMessageText" : "Activity Log: 25 (0/25) rows successful, 0 ignored ",
"hierarchyName", "Activity Log",
"successRowCount", "25",
"successCreateCount", "0", --> rows already exists
"successUpdateCount", "25",
"warningsRowCount", "0",
"warningsCreateCount", "0",
"warningsUpdateCount", "0",
"failedCount", "0",
"ignoredCount", "0",
"totalRowCount", "25",
"totalCreateCount", "0",
"totalUpdateCount", "25",
"invalidCount", "0",
"updatedCount", "25",
"renamedCount", "25",
"createdCount", "0"[executeGetApi] responseCode: 200 { "meta" : { "schema" : "<a href="<a href="https://api.anaplan.com/2/0/models/4F4E190CF08D4933BAD04DC452467CF6/objects/task" target="_blank">https://api.anaplan.com/2/0/models/4F4E190CF08D4933BAD04DC452467CF6/objects/task</a>" target="_blank"><a href="https://api.anaplan.com/2/0/models/4F4E190CF08D4933BAD04DC452467CF6/objects/task</a" target="_blank">https://api.anaplan.com/2/0/models/4F4E190CF08D4933BAD04DC452467CF6/objects/task</a</a>>" }, "status" : { "code" : 200, "message" : "Success" }, "task" : { "taskId" : "B52766DC8DE44102B8965CCD310338A4", "currentStep" : "Complete.", "progress" : 1.0, "result" : { "details" : [ { "localMessageText" : "Activity Log: 25 (0/25) rows successful, 0 ignored ", "occurrences" : 0, "type" : "hierarchyRowsProcessed", "values" : [ "hierarchyName", "Activity Log", "successRowCount", "25", "successCreateCount", "0", "successUpdateCount", "25", "warningsRowCount", "0", "warningsCreateCount", "0", "warningsUpdateCount", "0", "failedCount", "0", "ignoredCount", "0", "totalRowCount", "25", "totalCreateCount", "0", "totalUpdateCount", "25", "invalidCount", "0", "updatedCount", "25", "renamedCount", "25", "createdCount", "0" ] } ], "failureDumpAvailable" : false, "objectId" : "112000000049", "successful" : true }, "taskState" : "COMPLETE", "creationTime" : 1575054348472 } }
5. Another example of import errors
"localMessageText" : "Activity Log: 166598 (0/166598) rows successful, 0 (0/0) rows has warnings, 7 failed, 2498969 ignored",
{ "meta" : { "schema" : "<a href="https://api.anaplan.com/2/0/models/xxxx/objects/task" target="_blank">https://api.anaplan.com/2/0/models/xxxx/objects/task</a>" }, "status" : { "code" : 200, "message" : "Success" }, "task" : { "taskId" : "175CD35CE42A4B8DB0F42F2D1405B7EC", "currentStep" : "Complete.", "progress" : 1.0, "result" : { "details" : [ { "localMessageText" : "Activity Log: 166598 (0/166598) rows successful, 0 (0/0) rows has warnings, 7 failed, 2498969 ignored", "occurrences" : 0, "type" : "hierarchyRowsProcessedWithFailures", "values" : [ "hierarchyName", "Activity Log", "successRowCount", "166598", "successCreateCount", "0", "successUpdateCount", "166598", "warningsRowCount", "0", "warningsCreateCount", "0", "warningsUpdateCount", "0", "failedCount", "7", "ignoredCount", "2498969", "totalRowCount", "2665574", "totalCreateCount", "0", "totalUpdateCount", "166598", "invalidCount", "7", "updatedCount", "166598", "renamedCount", "166598", "createdCount", "0" ] }, { "localMessageText" : "Another row has already been processed with this key", "occurrences" : 2498969, "type" : "hierarchyImportDuplicateKeyInSource" }, { "localMessageText" : "Error parsing key for this row; no values", "occurrences" : 7, "type" : "hierarchyImportEmptyKey" } ], "failureDumpAvailable" : true, "objectId" : "112000000043", "objectName" : "Failures for Import 43", "successful" : true }, "taskState" : "COMPLETE", "creationTime" : 1574568161375 } }
1 -
Format of error dump file downloaded post import
"_Status_","1","7/1/2019 9:55","email@com.com","Change Line Item","_Line_","_Error_1_" "","2","7/1/2019 9:58","email@com.com","Change Module","166601","Another row has already been processed with this key" "","3","7/1/2019 9:59","email@com.com","Change Module","166602","Another row has already been processed with this key" "","4","7/1/2019 10:04","email@com.com","Change Line Item","166603","Another row has already been processed with this key" "","5","7/1/2019 10:04","email@com.com","Change Line Item","166604","Another row has already been processed with this key" "","6","7/1/2019 10:04","email@com.com","Change Line Item","166605","Another row has already been processed with this key" "","7","7/1/2019 10:05","email@com.com","Change Line Item","166606","Another row has already been processed with this key" "","8","7/1/2019 10:06","email@com.com","Change Line Item","166607","Another row has already been processed with this key"
1