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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Automate
Answered

Filter Array

(0) ShareShare
ReportReport
Posted on by 78

Hello community,

 

I do need to filter for a list item in an array with Power Automate Desktop.

The array looks as followed: see screenshot.

I cannot use the index value since the index of the desired item will change for every run.

Also the value cannot be used completely as its content also changes for every run.

What I need is a filter for a part of the value.

Im my case the property_id 85 is the constant value.

So, what I need is to filter for the line with property_id 85 or delete all the other lines.

Any help is very much appreciated.

bacprops.JPG
I have the same question (0)
  • UshaJyothiKasibhotla Profile Picture
    225 Moderator on at

    Loop through the array by using for each 

    Then use if condition 

    Inside if write the variable contains your constant value which you need to filter

    Then 

    Parse text by using regex take one line and 

    Use remove text remove all other lines 

    Hope this helps 

    Usha

     

  • Verified answer
    Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    If this is stored into a text blob initially, you could use Parse text with regular expressions enabled. Parse for { 'property_id': 85[^}]+}

    This will return a single value, that you can then convert to a custom object using Convert JSON to custom object.

     

    There is unfortunately no native action in PA to filter a list. An alternative to getting it via text processing would be looping through the values, as suggested by @UshaJyothi20 .

    -------------------------------------------------------------------------
    If I have answered your question, please mark it as the preferred solution. If you like my response, please give it a Thumbs Up.

    I also provide paid consultancy and development services using Power Automate. If you're interested, DM me and we can discuss it.

  • artivo36 Profile Picture
    78 on at

    After having solved this, I need to proceed further to get the "display value" of this particular line staring with "property:_id: 85".

    For this I tried to convert the filtered text back into a custom object, but it fails saying that there is an "unexpected character".

    Any Idea ?

  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    If you had converted it to a custom object before using Parse text, that is actually a bad idea. Please parse it as a JSON value, before converting it. Then convert the output of Parse text.

    If it still doesn't work, try using Replace text to replace a single quote ' with double quotes " before converting it.

    -------------------------------------------------------------------------
    If I have answered your question, please mark it as the preferred solution. If you like my response, please give it a Thumbs Up.

    I also provide paid consultancy and development services using Power Automate. If you're interested, DM me and we can discuss it.

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 386

#2
Valantis Profile Picture

Valantis 342

#3
Haque Profile Picture

Haque 336

Last 30 days Overall leaderboard