web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate
Unanswered

Parse an Array?

(0) ShareShare
ReportReport
Posted on by 170

I need the value of the location.  If I parse this, I get an error saying the input is an array and should be an object

MaryT0905_0-1640809105929.png

 

Categories:
I have the same question (0)
  • tom_riha Profile Picture
    10,185 Most Valuable Professional on at
    Re: Parse an Array?

    Hello @MaryT0905 ,

    it's an array, therefore, you must process it as an array first = add 'Apply to each' to loop through all the items and then extract the "locations".

    Or if it's always only a single item, you can use the first(..) expression to process the array and extract the value, e.g.

    first(<the array>)?['locations']
  • vikulkar Profile Picture
    on at
    Re: Parse an Array?

    @MaryT0905 ,

    Please try passing the entire Array in the 'Generate from sample' in the Parse JSON action which will produce the JSON in the form:

    {
        "type""array",
        "items": {
            "type""object",
            "properties": {
                "locations": {
                    "type""string"
                }
            },
            "required": [
                "locations"
            ]
        }
    }

    CommunityScreenshot2.png

    The location can be parsed as shown in the above flow.

     

    Thanks and Regards,

    Vikas K

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 462 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 456 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard