Showing results for 
Search instead for 
Did you mean: 

How to get around the limitation of not being able to assign nested source list

Deputy Chef II
Deputy Chef II


I'm struggling with how to work around the limitation of not being able to add a source list within a source list.  I was able to setup the structure in a for-each loop the way that I want it (at that level the list is only 1 level deep as I iterated through the top list).  However, once outside the loop I want to add the whole structure to a list that later will be sent as an array of json items to an api call.  The issue is the limitation that I can't transfer the structure that I just setup to a list of the same structure...the datapills will not allow anything into this lower source list  In the example below the "Source mapping source list" is the list at the top level and "Values" is within that.  This is based on a structure that is read in from a get api call and massaged with additional data before POSTing it back.

Any suggestions that I can try...I'm stuck at this point.  TIA!





Executive Chef III
Executive Chef III

Here's a way you can trick Workato to do this, but there are some downsides.

Let's say we have this payload, and you want to recreate this in a list:


  {"name": "vegetables",
   "list": [{"type": "garlic"},
              {"type": "onion"}]},
  {"name": "fruit",
   "list": [{"type": "apple"},
              {"type": "orange"},
              {"type": "pear"}]}


First, don't define the entire schema of the nested list. Instead, create a string input field.


Next, set the input field of the nested list to formula and drop in the "list" data pill.


Because it's in formula mode, Workato interprets the input as an array and parses it. (For fun, try re-running this with the input set to "text" and you'll see how Workato preserves the input as a string).

Here's the parsed output:


The downside of this method is without the fully-declared schema in the list action you can't easily access the data in the array with a data pill. However, you can still access the data using a formula with bracket notation. Here are some examples.

This navigates to the second item in the outside array and then the third item in the nested array and returns the full object:





This navigates to the second item in the outside array and then the third item in the nested array and returns only the "type" value:






Hope this helps!

View solution in original post


Really?! That blows my mind. I actually can't get that to work on my end!

Edit: Good grief, I just got it to work and I'm in awe 😂