Action Designer - Custom action to convert comma separated strings into array

Anish Reghu
Kilo Sage
Kilo Sage

Dear all,

Can someone suggest an action item which takes the input as comma separated strings and returns an Array?

NOTE - I need this as an custom action to be reused in the Flow Designer please.

Regards,

Anish

1 ACCEPTED SOLUTION

Akshay H Mulky
Kilo Guru

Hi Anish,

Here is the custom action to convert comma separate string to an array:

 

(function execute(inputs, outputs) {

  outputs.output_parameter = inputs.input_parameter.split(',');
  
})(inputs, outputs);

 

find_real_file.png

find_real_file.png

 

 

View solution in original post

9 REPLIES 9

Hi Akshay,

Thanks and I am yet to try it, but is keeping the output data type as String instead of Array.String correct here?

Finally, the result. I messed it as I had forgot to configure the Action output on the Action record (had only done it on the script).

 

find_real_file.png

Look at the output variable on the right. It is empty, does not return any value. I want the action item to return a value in a format that is acceptable for iterations like For Each Item. This is why I was seeking the output in Array.String format

I corrected the double quotes to single quote within the split method call.

jmiskey
Kilo Sage

The accepted solution only worked out for me when I changed the Output types to "Array.String" in BOTH the Script section and the Outputs section.  Once I did that, it worked out for me (I am trying to use it in a "For Each" Action in my Flow).