cancel
Showing results for 
Search instead for 
Did you mean: 

Convert comma-separated string to list / array

Eike-Baur
Deputy Chef I
Deputy Chef I

Hi everyone,

I just started with Workato because our new CRM (Recruit) uses it as a whitelabel automation solution. I have been using other platforms like Make for years though. Here's a snippet of what I am setting up right now:

Screenshot 2025-05-15 163202.png

My question might seem very simple, but I could not find a straightforward answer in either the Workato docs, this forum or the general web: How can I take the "Related" output field from step 1 (a string of comma separated values) and convert it to a simple list (aka array) of strings to use as the input for step 4 (for each loop)? I know this would be possible using <Related>.split (","), but I cannot enter this into the list input field of the for each step because list fields do not support formula mode.

Can anyone help me out here?

1 ACCEPTED SOLUTION

Hi there,

just when you replied (of course), I was able to solve it using a JSON parser in one step:

 

Screenshot 2025-05-15 175939.png

To be honest, I find it a bit ridiculous that this is so convoluted in Workato, having worked with Make where this would be just one formula which you can enter into any field you desire. But hey, it works now I guess :).

Best, Eike

View solution in original post

3 REPLIES 3

1dheeraj2
Deputy Chef III
Deputy Chef III

Hi @Eike-Baur ,

Although we can accomplish this in Workato using a while loop, by employing an index in the while loop on the values obtained after Related>.split(",") and accumulating them into a list variable one by one, ending the while loop when there is no data, and then use the list for for each loop. This approach will require more tasks based on the number of comma-separated values.

Alternatively, you can write a simple python, ruby or javascript do do the same; this will be a better solution in terms of task consumption.

Do let us know if you find any better solution. We encountered the same problem and used Python to solve it. 

Hi there,

just when you replied (of course), I was able to solve it using a JSON parser in one step:

 

Screenshot 2025-05-15 175939.png

To be honest, I find it a bit ridiculous that this is so convoluted in Workato, having worked with Make where this would be just one formula which you can enter into any field you desire. But hey, it works now I guess :).

Best, Eike

1dheeraj2
Deputy Chef III
Deputy Chef III

Awesome, I never thought we could use a JSON parser here as well. This is a learning experience for me too. Thanks a lot for sharing!