cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AlessandroP
Helper II
Helper II

Dummy Question - How to extract value from an array that contains one object

Dear community

 

[
{
"BatchOrder": "PB00000478"
}
]

 

I would like to extract PB00000478 from this array.

Can you please show me the syntax to do so?

2 REPLIES 2
Expiscornovus
Dual Super User
Dual Super User

Hi @AlessandroP 

 

You could either use the first function or use an index [0] to retrieve the first item of the array. With ['BatchOrder'] you can specifically retrieve the BatchOrder value.

 

Below are two examples with expressions in Compose actions

 

 

variables('MyArray')[0]['BatchOrder']

 

 

 

first(variables('MyArray'))['BatchOrder']

 

 

firstorindex.png

Thank you.

 

It worked.

 

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.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

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,034)