Output array.string to Record in Flow Designer

DylanB
Tera Guru

Hi all, I'm thinking this should be a pretty simple solution but I'm not finding it. I'm using the Active Directory v2 spoke to get the list of groups that a user is a member of. That returns an array.string output. I'd like to take that list of groups and post it as a comment on a SCTASK. 

 

Dragging the data pill to the work notes comments results in the following. What am I doing wrong?

DylanB_0-1709057989820.png

 

1 ACCEPTED SOLUTION

No luck on that either. While looking at that look up action, I noticed that the PowerShell step outputs all the data that it looks up in a string format, including the membership.

DylanB_2-1709233773630.png

 

This gave me the idea to copy that Look Up User in AD action and remove all the Powershell attributes it looks up except for group membership, then store the Powershell output string as the membership output. That allows the membership to be displayed in string format to be used elsewhere in the flow. 

DylanB_4-1709233987188.png

 

It's not the prettiest output so I might go back and do some tidying up on it, but for now, it works well enough.

 

I'm not sure why other solutions weren't giving us the info we were looking for. I have to assume there is some bug with the AD spoke and this array. Additionally, this action should probably be OOB for this spoke. Being able to get full group membership for a user can be useful. 

 

I want to thank you all for responding. I learned a lot from this discussion and appreciate all the feedback!

View solution in original post

31 REPLIES 31

What are you passing to this action? What's coming in the Array String?


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

Hi @DylanB 

 

What output is being returned by Active Directory v2? Is it an array of JSON objects?
Would you kindly share the details of the output, if possible?

 

Regards,

Sasikanth

 

Hi @sasi_v and @SanjivMeher,

 

I'm passing the Member Of output data pill from the AD look up to the "Convert array.string to string" action.

 

This is what my test flow looks like.

DylanB_0-1709130202935.png

 

That Member Of data pill shows the following output in the operation execution logs.

DylanB_2-1709130285055.png

 

The formatted view of that output looks like this.

DylanB_3-1709130349734.png

 

Hi @DylanB ,

 

Add a script step with input type as array.string and output type as string

Refer  the script in the screenshot for parsing the input

 

sasi_v_1-1709138577619.png

 

Map the output data pill of the script step to the comments field

Hi @sasi_v

 

I don't have much experience with scripting so I may have misunderstood something but no luck yet.

 

I modified my "Convert array.string to string" action. The input is set as array.string.

DylanB_0-1709141258131.png

 

The script step was changed to the following. I did run into an error with the "var finastr.join(",")" line and removed "var".

DylanB_1-1709141447105.png

 

The output is set to the following.

Script step output:

DylanB_2-1709141501735.png

 

Action output datapill:

DylanB_3-1709141539675.png

Action output configuration:

DylanB_4-1709141543613.png

 

This time when running the flow to lookup the user and return the list of groups, I get a bunch of commas. 

DylanB_5-1709141590008.png

 

I appreciate the continued help with this!