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.

Passing data to a Sub Flow Input of Array.String type

Steven Parker
Giga Sage

So I have a Sub Flow with an input variable of type Array.String and it's named 'pcname'.  If I test the flow and just type a name in there it works fine.  However, when I use the Code Snippet and try to pass a string variable (converted to an array) to that Sub Flow input, it errors out.  

 

How do I pass data to the 'pcname' "Array.String" input variable on the Sub Flow?  I am just passing 1 variable for now.

 

StevenParker_0-1758914923152.png

 


Please mark this response as correct and/or helpful if it assisted you with your question.
Steven
10 REPLIES 10

I am trying to send 1 PC Name to the subflow, get the Object ID, and add it to a group essentially.  I've tried doing it with all string inputs and I've tried doing it with the PC Name as an array...either way works when testing, but not when passing the pcname via a run script.

 

Here are the Flow inputs for the flow using all string inputs:

StevenParker_0-1759242837206.png

 

Here are the Flow input for the flow using an Array.String as an input.  I even tried to set the ID in this one to a string flow variable...still errors with that same error from the previous post screenshot, but works when "Tested":

StevenParker_1-1759242887102.png

 

 

Crazy thing is...I went ahead and built my own Rest Message and Run Script to do exactly what this Flow is attempting to do (get Device ID and add Device to group).  I am learning that Flow Designer has some real inconsistencies and unexplainable issues.  So I am not sure I can rely on it for certain things I am trying to do. 

 


Please mark this response as correct and/or helpful if it assisted you with your question.
Steven