cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Dhiran
Helper III
Helper III

Accessing Array elements

I have a flow which looks at incomng email from a specific address and creates an array of the subject heading using the Split command. I would like to the 2nd element of the array in the next step to create an calendar event. 

 

If i just place the arrary in the next element I can see the following structure ["Text element 1","Text element 2"] 

 

Is there a way I can get only "Text Element 2" in my next step.

 

Here is a screen shot of steps

Split Command.png

1 ACCEPTED SOLUTION

Accepted Solutions
v-xida-msft
Community Support
Community Support

Hi @Dhiran,

Please take a try with the following workaround:

  • Add Variables-> Initialize variable action after “Compose” action, Name set to TextArray, Type set to Array, Value set to output of “Compose” action.
  • In “Create event (V2)” action, type the following formula in Subject parameter:
@variables('TextArray')[1]

Image reference:2.JPG

 

The flow works successfully as below:3.JPG

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-xida-msft
Community Support
Community Support

Hi @Dhiran,

Please take a try with the following workaround:

  • Add Variables-> Initialize variable action after “Compose” action, Name set to TextArray, Type set to Array, Value set to output of “Compose” action.
  • In “Create event (V2)” action, type the following formula in Subject parameter:
@variables('TextArray')[1]

Image reference:2.JPG

 

The flow works successfully as below:3.JPG

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Hi @v-xida-msft (Kris) that worked so thank you. The only issue was the expression would not take the "@" symbol but I could just addd the line without the "@".

worked perfectly! 

Thanks,

Hasan

philkky
Frequent Visitor

I want to do something similar, I have an array and I was to loop through each entry putting the value in to an HTML table. In this case the formula 

 

@variables('TextArray')[1]

 

 Will keep giving me the same value for the number of items in the array, how do I increment this number or should I take a different approach?

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Users online (54,615)