Happy Business Starts Here

Valued Scholar

How to iterate over an object (not the exported file or custom liquid statement).

I'm creating a new workflow and after I export and attempt to add an iterate step, I do not have the option to select an object to iterate over.  I only have the option to iterate over the export file or custom liquid statement.  But the sample workflows have iteration steps that iterate over an object (although that isn't editable).  How can I set up a step to iterate over an object please?  See screenshot - I'm attempting to add where I don't have the option to select an object.  If I could upload more than one file I would show where the sample workflow that came with Connect, where an object is iterated over (not a file or custom liquid statement).  Thank you.

Screen Shot 2018-08-30 at 8.48.41 PM.png
9 REPLIES 9
Senior Tutor

Re: How to iterate over an object (not the exported file or custom liquid statement).

I'm not sure if you've gotten the answer to your question yet, but to iterate ove the export query you would select the thing you just exported. In this case, the zip file. 

 

If you want to iterate over something else you can, but you need to query it first. Either via an export or a regular "query". Just take note -- a regular query is limited to 2000 records currently. 

 

See the attachment. The first step is a regular query. The next step iterates over the "Account" object (the dropdown on the iterate dialog will give you the option in the dropdown to iterate over the "Account" object).  Then the third step allows you to access each item in the resultset as {{Data.Account.Id}}   or {{Data.Account.AccountNumber}} as well as any other field you've selected to add to the SELECT in the query step.

iterate.png
Newly Enrolled

Re: How to iterate over an object (not the exported file or custom liquid statement).

I'm having the exact same problem. I do the export, but it doesn't give me anything to Iterate. Workflow Export Iterate.png

How do I get to iterate the object the Export is exporting?

Valued Scholar

Re: How to iterate over an object (not the exported file or custom liquid statement).

Per Zuora support, the csv file is what you exported so that's what you iterate over.  In an older version of the interface, the object name was listed instead of the .csv.  So the out of the box sample workflows that come with Connect show the object name, but it's really the .csv file.

Senior Tutor

Re: How to iterate over an object (not the exported file or custom liquid statement).

Yep. That's my experience too. You select the CSV as the thing to iterate over, and it might give you further options once you pick that. 

 

After the iterate task, then you can access {{Data.Account.SomeField}} for instance. 

Newly Enrolled

Re: How to iterate over an object (not the exported file or custom liquid statement).

Thank you, that was just what I needed. It'd be nice if the sample workflows could be updated to look like the current system, as I'm sure I'm not the only one who uses them as examples.

Valued Scholar

Re: How to iterate over an object (not the exported file or custom liquid statement).

You're welcome and agreed, especially given there is little useful documentation available for the workflows.  I'm not a Zuora employee however, just another user and happy to help.

Highlighted
Senior Tutor

Re: How to iterate over an object (not the exported file or custom liquid statement).

I hear you. there are some things that aren't documented. 

 

One thing I discovered this week -- 

 

If you have a job that runs on a schedule, you can schedule it to run every 5 mins.  If the previous job isn't finished yet, it won't kick off the new task. 

 

So if you want a job that will only run one instance at a time, you can go into the settings for the workflow and make it run on a "schedule" to perform that. 

Valued Scholar

Re: How to iterate over an object (not the exported file or custom liquid statement).

Thanks for that, I have one job scheduled daily so whether they run syncronously or async wasn't a concern but good to know, sure it will come up in the future.  Thanks.

Senior Tutor

Re: How to iterate over an object (not the exported file or custom liquid statement).

You bet. 


Another thing they added a couple weeks ago was a way to "pause".  You can query an object, and if it doesn't have the value you want, you can pause for X seconds, and requery it (by connecting the pause task's arrow back to the query task) and when it has the value you want, you can have the "if" test move on to the "true" steps. 

 

Sure, you can end up with an infinite loop if the thing you're querying for never changes.  I haven't figured out how to mitigate that case yet.  (I could potentially check the workflow.startDateTime against now() and if it's over X seconds, send an email and stop)