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 Platform Community / Forums / Power Automate / Trying to write an exp...
Power Automate
Answered

Trying to write an expression instead of using Filter Array

(1) ShareShare
ReportReport
Posted on by 20
Hello everyone
 
I create this follow array using a Select action after List Buckets Action for a MS Planner Board. I am wondering if I can write an expression instead of using a filter array and then a compose to get the bucketid when the bucketname is "To do".
{
    "body": [
        {
            "bucketid""xOfg9k9Xu0-DmGU3PHdQPGQAANep",
            "bucketname""Done"
        },
        {
            "bucketid""uskhJSr-tUaZGan7DeIvOGQANnfy",
            "bucketname""Hold"
        },
        {
            "bucketid""EXaN1yv3m0y4CnDpJS0IHGQADIFF",
            "bucketname""In Progress"
        },
        {
            "bucketid""knOOX-GfSUuN4HjPC9n6ZWQAAkhY",
            "bucketname""To do"
        }
    ]
}
Categories:
I have the same question (0)
  • Verified answer
    Fredrik_A Profile Picture
    3,570 Super User 2026 Season 1 on at
    Hello,
     
    I believe Filter array is your best bet here, unless the bucket is always returned as the 3rd element for example. In that case you could do Array[2] for example. Is there any reason you would like to get ridd of the Filter array? In my experience its very fast. 
     
    If my response solved your issue, please mark it as ✅ Accepted Answer and give it a like.
  • AI-24061946-0 Profile Picture
    20 on at
    I am new to this platform and wanted to see if there are other ways of accomplishing this, but your answer makes perfect sense as I am doing that currently and thank you for your prompt response.  
  • Verified answer
    WillPage Profile Picture
    2,323 Super User 2026 Season 1 on at
    If you absolutely must avoid using the Filter array action, you can convert the JSON array to XML and then use the xpath() function to lookup an individual item on the buckename and return the bucketid.
     
    1. Original JSON
     
    2. Add a root property
     
    3. Convert to XML
     
    4. XPATH function
     
    Output is the bucket ID. No Filter array action:
     
    Big question though: Why would you do this? It's more work.
  • Verified answer
    Chriddle Profile Picture
    8,672 Super User 2026 Season 1 on at
    first(
    	xpath(
    		xml(
    			addProperty(
    				json('{}'),
    				'Root',
    				addProperty(
    					json('{}'),
    					'Item',
    					body('Compose')
    				)
    			)
    		),
    		'//Item[bucketname="To Do"]/bucketid/text()'
    	)
    )
  • AI-24061946-0 Profile Picture
    20 on at
    Thank you so much for opening up my eyes about using Xpath. You are 100% correct that at my beginning skill level, using the Select array gets the job done. I wanted to see how advance users would handle this issue using other mechanisms.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 592

#2
Valantis Profile Picture

Valantis 340

#3
11manish Profile Picture

11manish 284

Last 30 days Overall leaderboard