Skip to main content

Hi all,

I have a workflow which contacts an API and obtains a json from it. The json has many fields, but I am interested specifically in the name field. Below is an incredibly trimmed down version of the json:

{
"people_list":
{
"name": "John Smith",
},
{
"name": "Joe Bloggs",
},
{
"name": "Jane Doe",
},
etc...
]
}

This response can return a json of different lengths depending on other options set in the Workflow, where sometimes there are more/fewer “people”.

As apart of this workflow, I’d like it to add a note containing the list of people that were returned. For example, if I had the above json returned it would add a note saying:

Names Found

John Smith

Joe Bloggs

Jane Doe

 

I understand I can access these individually using indexes (people_list.namel0], people_list.namel1], etc...), but I would like to do this automatically for each row it finds rather than addressing each index individually.

Is there a way to iterate through an array of strings in this way when adding notes to tickets via a Workflow? 

This is my first time trying to use the expression builder/liquid filters, so any help would be greatly appreciated


Thanks!

Most of us are waiting for the looping in workflows to be released to see if this is possible.  At this point you will have to add the maximum number of indexes to that array in order to get all of the items.  


Reply