Issue with "Un-import Command
BeantwoordHi There - I am running into an issue using the "Un-Import File From Table" Command. The chain this command is in, fetches the file ID of the file in the data table (and after using the Array to CSV and an advance query to get the file ID) un-imports the file and then deletes it. After this is completed the second half of the chain continues and fetches an updated file using the "Run Custom Report" command (for Sage Intacct) and imports the file into the data table.
This issue is, if the second half of the chain does not execute for some reason (ie, the fetching of the new file from the "Run Custom Report" command), then there is no active file in the data table and the next time the chain runs, I get the following error - because it is looking for an imported file to un-import.
I have included a screen shot of our chain below. Is there a way to prevent this? Or a cleaner way to do this? Thanks for any help.
PS - We love chains!
ERROR RECEIVED.
Error: current file status is STAGED but must be one of [IMPORTED, IMPORTING]. Code 400
Result: Error: current file status is STAGED but must be one of [IMPORTED, IMPORTING]. Code 400
-
The error means that the 'Un-import File' command is trying to un-import a file that is already un-imported (staged). This usually happens if the 'Import File into Table' command fails on the previous run of the Chain. There are a couple of things you can do to handle these cases in the future.
First, I'd recommend adding a couple of retry attempts to the Workiva nodes. See step 4 here https://support.workiva.com/hc/en-us/articles/360036003671-Manage-Commands-in-Chains#section4 for a little information on where to find and setup retries. Adding 3 retries with a 15 to 30 second gap can help mitigate any network communication noise.
Second, since the file failed to un-import because it was already in an un-imported state, the 'Delete File' node can still execute to delete and clean up that file. In the 'Delete File' node, rather than getting the File ID from the un-import node output, get the File ID from the Extract Value output (just like you're doing with the Un-import node). This way, if the un-import node fails, 'Delete File' will still attempt the delete as it is no longer relying on the success of the un-import node to get the ID. Alternatively, you could build logic in to extract the status of the file and either add a skip condition to the un-import node or branch using a Conditional node if the file exists and which state it is in.
0U moet u aanmelden om een opmerking te plaatsen.
Opmerkingen
1 opmerking