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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / How i can Filter an Ar...
Power Automate
Answered

How i can Filter an Array using expression inside a Select action

(0) ShareShare
ReportReport
Posted on by 1,811 Super User 2024 Season 1
I have this as part of a workflow:-
 
1) I am building an array which contain NetworkID-NetworkTitle
 
2) Then i need to filter the array based on the Array start with ID-
 
3) then to get the NetworkTitle
 
here what i have:-
 
 
 
 
so is there a formula i can use to filter the array based on this formula:-
 
Item Array start with item()?['ID']-
 
and then get the NetworkTitle?
 
Thanks
Categories:
I have the same question (0)
  • Verified answer
    ManishSolanki Profile Picture
    15,091 Super User 2025 Season 2 on at
    Hi,
     
    You can use xml & xpath functions to achieve this.
     
    Firstly, in array variable you need to store the object instead of plain text as shown below:
    {
    "uniqueid": "<dynamic id value>-<dynamic title value>"
    }
     
    Before select action, add compose action to convert variable in xml format. Use below expression to convert to xml. Expression needs to be entered in the 'Function' window:
    xml(json(concat('{"root":{"items":',variables('NetworksIdTitle'),'}}')))
     
    Finally, to get the title from array variable based on the id use xpath function. Enter the below expression in title map property value to get the required value:
    last(split(xpath(outputs('Compose'), concat('string(//uniqueid[starts-with(text(),"',item()?['ID'],'")]/text())')),'-'))
     
     
     
     
    OUTPUT:
     
     
     
     
    If this helps & solves your problem, please remember to like and accept my solution as it will help others in the future.
     
  • johnjohnPter Profile Picture
    1,811 Super User 2024 Season 1 on at
     
    worked very well ,, thanks

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 519 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 296 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard