cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to see formula mode in Add items to List Batch Action

amit_mohanty88
Deputy Chef I
Deputy Chef I

I have a usecase where i need to call a rest service get response which contains repeating element node so i am capturing the response in Add items to List (Batch) Action . While adding the source list in Add Item to list one of the repeating element i want to put a condition if source repeating element size is zero loop should not happen . how to do this . Currently issue am getting is if source element node size is zero then in Add items to List (Batch) Action the output of the element is coming [] . Screenshot attached . Basially i dont need the elment itself instead of elment coming as [] looping.png

loopingoutput.png

 

 

 

3 REPLIES 3

gary1
Star Chef I
Star Chef I

I'm not totally sure I understand the situation, but there's no way to use formula mode on a list items. Workato simply doesn't allow it.

If you want to avoid the loop on the root array, you can use a conditional before have to test if the list size is zero. 

If you want to do this on a nested array within the root array, you can't do it formulaically. 

There are ways to do this without using formulas, but I would need more information and examples to understand the situation and offer a solution.

rajeshjanapati
Deputy Chef III
Deputy Chef III

Hi @amit_mohanty88,

try once with PARSE JSON by passing complete API response into PARSE JSON step, where you can extract each field as a data pill and you can easily check the condition, hope it will be helpful.

Thanks & Regards,

J Rajesh Kumar.

Bhagya_pola
Executive Chef I
Executive Chef I

Hello @amit_mohanty88 ,

I still don't get why you are using add items to list if the response is of repeating items like list of objects or something, since the response schema is consistent, you can define the response schema in the http step itself