Using Workato Lists to Parse Objects & Compose a CSV to upload to Box
Before the recent addition of the Lists Utility in Workato, you had to find a way to get your list perfectly set before you utilized it in a Compose CSV action. If your requirements dictated the need for an If/Then action to check for additional criteria after getting your list from your search action, then it simply wouldn’t work. Here’s an example that doesn’t work (yes, I learned the hard way).
- Here we search for our list, which you can filter for certain data but you’d have to use fairly complex formulas to get your specific data. (I like easy, so this doesn’t work for us or our clients if they have to go back and change it later)
- Our For Loop that goes through each records from our first step.
- In this If action we want to check to see if they’ve downgraded within the last 7 days since the job ran (this Recipe runs weekly).
- Compose the CSV from the list of items from Step 2. This is where the problem lives, if one record passes the If action, it will pull all of the items from the list in step 2!
Now with the Lists Utility you can parse through a list from a previous step to pull out records/items that meet your new criteria! This makes it incredibly easy to do those complex formulas with your If statements.
- In Step 1 we search for our records again.
- Here we run through each record like we did in the example above.
- Now we check each item for our specific criteria and if it passes then…
- Append that item to our new list. This item ID is pulled from the Step 2 list.
- Now when we go to compose our CSV we pull the list from step 4!
Hopefully you’re not reading this post because your stuck like I was in my first example. If you’re there feel free to reach out to me by filling out our contact form. I’d be happy to give your recipe a quick review!
[contact-form-7 id=”536″ title=”Contact form 1″]