cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Bochie
Resolver I
Resolver I

Processing Arrays

Hi All!

Based on the sample array below, how can I append to a string all the First Names? I tried to use ParseJSON but the "FirstName" doesn't even show up in dynamic content. I tried to use Select data operation but I couldn't get the expression right.

"Members": [
{
 "FirstName": "John",
 "LastName":"Doe"
},
{
 "FirstName": "Jane",
 "LastName": "Smith"
},
{
 "FirstName": "Jason",
 "LastName": "Lost"
}
]

 Thanks for any leads/insight!

-bochie

1 ACCEPTED SOLUTION

Accepted Solutions
DamoBird365
Super User
Super User

Hi @Bochie 

 

DamoBird365_0-1632771771295.png

 

Compose is your sample array, they I use select to create an array of first names and then join to create a string.

DamoBird365_1-1632771931900.png

 

This video has some details on manipulating Arrays https://youtu.be/6nJSUNh579w

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Cheers,
Damien


P.S. take a look at my new blog here and like & subscribe to my YouTube Channel thanks 😉

 

View solution in original post

2 REPLIES 2
DamoBird365
Super User
Super User

Hi @Bochie 

 

DamoBird365_0-1632771771295.png

 

Compose is your sample array, they I use select to create an array of first names and then join to create a string.

DamoBird365_1-1632771931900.png

 

This video has some details on manipulating Arrays https://youtu.be/6nJSUNh579w

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Cheers,
Damien


P.S. take a look at my new blog here and like & subscribe to my YouTube Channel thanks 😉

 


UPDATE:

I did manage to get it to work 😃 I couldn't show it initially but the "array" was coming off a Select operation and was indeed being converted to string instead of an array. I tweaked my expression in the Select and it was passed an array moving forward. Couldn't have solved it without your help @DamoBird365 . Thank you so much!

Hi @DamoBird365 , thanks for your reply. I tried to follow your video and instructions but I'm getting this error, 'The template language expression 'outputs('Compose')?['Members']' cannot be evaluated because property 'Members' cannot be selected. Property selection is not supported on values of type 'String'. 

What am I doing wrong?
My Select From: outputs('Compose')?['Members']

Mapitem()['FirstName']

Helpful resources

Announcements
MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

New Process Advisor Capabilities carousel.png

Read the blog for the latest news

Read the latest about new experiences and capabilities in the Power Automate product blog.

PA Survey Carousel Image.png

We want to hear from you!

If you are a small business ISV/Reseller, share your thoughts with our research team.

Users online (2,149)