Classic file types are no longer available for use as of January 2021. You can transition your classic files or download a PDF. Learn More

Bug in skip condition check for Advanced Query?

Answered

Comments

10 comments

  • Jeff Hickey

    Hi Waldo, we are looking into the skip logic backend at this time. In the meantime, I'd recommend migrating your Chains off of the deprecated list files output.

    0
  • Waldo Nell

    Thanks.  The only reason I used the deprecated result is because I could not get the other one to work.  Files List returned something that I did not know how to match against an empty array to skip if no records were returned.

    0
  • Jeff Hickey

    Hi Waldo, I wanted to follow up on the Skip Conditions behavior. We have identified a fix and expect to have it live either end of this week or early next week. Thank you for point this out to us.

    Additionally, to replace the Convert JSON to CSV command using the deprecated files list, I recommend looking at the node Array to CSV in the JSON bizapp (https://support.workiva.com/hc/en-us/articles/360036005871-JSON-Commands#section1) and select the 'Files List' from the output of the 'List Files' command.

    0
  • Waldo Nell

    Will check it out.

    0
  • Krishma Gupta

    Hi Jeff,

    Even I am trying to add a skip condition to the "un-import file from table" command after the "List files" command. I want to skip when List files has an empty JSON string. I can not figure out how the skip condition will work here.
    I tried a bunch of combinations here both with file list and file list deprecated, but none seem to work:
    - JSON file list is blank
    - String file list is blank
    - JSON file list = (empty)
    - String file list = (empty)
    - String file list (0) is blank

    Will be helpful if you can help me write the skip condition here.
    I am trying to avoid using the JSON-array to CSV and Tab transformation- filter rows count just for the skip condition.

    0
  • Jeff Hickey

    Hi Krishma. If you are iterating over a list of files to unimport, I imagine that you have the commands in a Group. If the List Files returns an empty array, the Group will be skipped assuming you've configured it to iterative over the list. If you've configured it a different way, the easiest way may be to use a Conditional command prior to your unimport to check if the array has a value in the first index or not. If there is a value, then you know that at least one file is in the table.

    0
  • Krishma Gupta

    Hey Jeff,
    Thank you for your response. Even for the conditional command, the challenge remains the same.

    If I pass the "file list" (from list files command) as is, it is a file name, hence gives an error. I have attached the screenshot of the log below:

    When I pass the "file list" using "get value from JSON", I get the "Error executing transformation "path not found [0]"" error when the wdata table doesn't have any dataset, hence list files is empty.
    Also attaching the screenshot of my skip/conditional conditions. Can you spot anything I could do differently here?





    0
  • Jeff Hickey

    The error "Error executing transformation "path not found [0]"" only happens when the array is empty, meaning no file are present in the table. When one or more files are present in the table, path 0 to n will be in the array so the error will not be thrown. You could use this information in your conditional check.

    0
  • Krishma Gupta

    Hi Jeff,

    I understand the conditional check now. Below is the chain I am iterating, but not over list files. I only want to skip "Get file properties" and "un-import" commands and proceed with the onward command for importing the latest file in the chain in the same iteration. With conditional, the remaining iteration stops entirely.
    One workaround I could think of is creating two group nodes and iterating un-import of all the tables, followed by import of all the tables in the second iteration.
    Is there any other better and neater solution, that you would rather recommend?

    0
  • Jeff Hickey

    I'm not sure I fully follow the use case described. From your description and image you provided, I believe that your Chain is grabbing some information from a Sheet and iterating over that data. For each piece of data, it attempts to remove old data from a table and then get new data from Oracle and import that. Is this the correct logic of the Chain? If this isn't correct, could you provide more information about your Chain and use case.

    If the above description is correct, then you could do this by following this tutorial https://support.workiva.com/hc/en-us/articles/360047103831-Update-datasets-in-a-table-as-a-chain. It takes some input for the Run Time input which in your case could be the extracted data and/or the data from Oracle. It checks to see if an old file exists and removes it. Then it imports the new file. You may be able to adapt this to your Chain so that it is called within the Group iteration.

    0

Please sign in to leave a comment.