How to Convert List type to Array.Object type in Flow?

Daemon5
Tera Expert

Hi!
I have an Array.Object variable in my Subflow Outputs and My goal is to put List type variable into it by "Assign Subflow Outputs".
To do this, I first thought I need to comma-separate the List and process it so that it goes into an Array.Object type.


Action number #1 is "Look up Record" which looks up the table that contains type List column.
*List column references 3 columns of type String.

 

What I tried is to make Action in #2"For Each" to look at the #1 table,
and tried to convert the List to Array.Object using Expand Script of #3"Set Flow Variables".
But it didn`t work well.

Any advice would be helpful.

1 ACCEPTED SOLUTION

Sumanth16
Mega Patron

Hi @Daemon5 ,

 

 

Please refer to below thread:

 

https://www.servicenow.com/community/developer-forum/flow-designer/m-p/1653167

https://www.servicenow.com/community/now-platform-forum/flow-designer-foreach-loop-on-service-catalo...

 

If I could help you with your Query then, please hit the Thumb Icon and mark it as Correct !!

 

Thanks & Regards,

Sumanth Meda

View solution in original post

8 REPLIES 8

vermaamit16
Kilo Patron

Thank you!

But is it possible to achieve conversion using Expand script not making new action?

 

Regards

Daemon.

You can definitely give it a try ! it should work. Ultimately, all we require is a comma separated input string which we need to convert to Array of Objects using the split method.

Aman Kumar S
Kilo Patron

Hi @KellyLewins 

Can you share the snapshot how exactly you created the script, and how are you passing values to the input