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 - Building Flows
Answered

Choose one JSON object from multiple based on specific value

(0) ShareShare
ReportReport
Posted on by 93

The below example is the output from an Initialize Variable step. How do I choose just the object whose file_type equals M4A?

 

[
 {
 "id": "value",
 "meeting_id": "value",
 "recording_start": "2022-02-01T20:09:15Z",
 "recording_end": "2022-02-01T20:09:24Z",
 "file_type": "M4A",
 "file_extension": "M4A",
 "file_size": 141805,
 "play_url": "URL",
 "download_url": "URL",
 "status": "completed",
 "recording_type": "audio_only"
 },
 {
 "id": "value",
 "meeting_id": "value",
 "recording_start": "2022-02-01T20:09:15Z",
 "recording_end": "2022-02-01T20:09:24Z",
 "file_type": "TIMELINE",
 "file_extension": "JSON",
 "file_size": 953,
 "download_url": "URL",
 "status": "completed",
 "recording_type": "timeline"
 },
 {
 "id": "value",
 "meeting_id": "value",
 "recording_start": "2022-02-01T20:09:15Z",
 "recording_end": "2022-02-01T20:09:24Z",
 "file_type": "MP4",
 "file_extension": "MP4",
 "file_size": 167422,
 "play_url": "URL",
 "download_url": "URL",
 "status": "completed",
 "recording_type": "shared_screen_with_speaker_view"
 }
]
I have the same question (0)
  • DanielGAJohnson Profile Picture
    93 on at
    Re: Choose one JSON object from multiple based on specific value

    This is the result I want:

     

    {
     "id": "value",
     "meeting_id": "value",
     "recording_start": "2022-02-01T20:09:15Z",
     "recording_end": "2022-02-01T20:09:24Z",
     "file_type": "M4A",
     "file_extension": "M4A",
     "file_size": 141805,
     "play_url": "URL",
     "download_url": "URL",
     "status": "completed",
     "recording_type": "audio_only"
     }
  • Svenny Profile Picture
    153 on at
    Re: Choose one JSON object from multiple based on specific value

     The simplest way would be to use the action "Filter array", with the array you are working with as an input.

    In the condition part of the action, specify "file_type" field on the left side, set the condition to "is equal to" and in the right field specify "M4A" as your target.

    The output would be an array containing only items with file type M4A.

    Reference: https://docs.microsoft.com/en-us/power-automate/data-operations#use-the-filter-array-action

  • DanielGAJohnson Profile Picture
    93 on at
    Re: Choose one JSON object from multiple based on specific value

    @Svenny thanks for the reply!

     

    I'm having trouble specifying the "file_type" field. In the reference you have it shows the field already as dynamic content, but it's not showing in my dynamic content tool tip. Is there a way with an expression to specify the "file_type" field?

     

    Filter Array.PNG

  • Verified answer
    Svenny Profile Picture
    153 on at
    Re: Choose one JSON object from multiple based on specific value

    No problem!

     

    Yes, you can type this into the expression tab in order to reference the "file_type" field, since dynamic content is not available:

     

     

    item()?['file_type']

     

     

     

    You can also use the "Parse Json" action to make the values in your array variable available as dynamic content for you to work with.

     

    This requires you to specify a schema. The simplest way to do this is to paste your data as example data, and have Power Automate generate it for you.

     

  • DanielGAJohnson Profile Picture
    93 on at
    Re: Choose one JSON object from multiple based on specific value

    That worked. Thanks @Svenny !

  • Svenny Profile Picture
    153 on at
    Re: Choose one JSON object from multiple based on specific value

    @DanielGAJohnson  Great to hear! Glad I could help.

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

Coming soon: forum hierarchy changes

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

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 535 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 348 Moderator

#3
developerAJ Profile Picture

developerAJ 262

Last 30 days Overall leaderboard