Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

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
Kilo 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

Thank you.

The first picture is flow, and 2nd is the script I tried.
Error wont happen when I tested though, Flow variables are filled with ["undefined", "undefined", "undefined"].

スクリーンショット 2024-02-27 125127.pngスクリーンショット 2024-02-27 133035.pngスクリーンショット 2024-02-27 133453.pngスクリーンショット 2024-02-27 125203.png

Sumanth16
Kilo 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

Daemon5
Tera Expert

I made it! Thank you All!!!

Mark Manders
Mega Patron

I guess this discussion continues here: https://www.servicenow.com/community/developer-forum/how-to-get-variables-from-input-records-in-flow...?

 


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark