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 / Can we get all items f...
Power Automate
Unanswered

Can we get all items from SharePoint list and filter the list using formula

(0) ShareShare
ReportReport
Posted on by 1,837 Season of Giving Solutions 2025
I have a SharePoint online list which contains 2 columns; Title & PrincipleID . Both of type single line of text.
 
 
Now i want to get all the items from the list (which can be 15 on the PROD environment), then filter the items based on the Title column using formulas, and get the PrincipleID and pass it to different child flows inside our main flow.
 
Now i tried this test to get the PrincipleID of the Admin, but i got this error:-
 
 
 
 
 
Unable to process template language expressions in action 'Compose' inputs at line '0' and column '0': 'The template language expression 'first(equals(outputs('Get_items')?['body/value']?['Title']),'Admin')?['PrincipleID']' cannot be evaluated because property 'Title' cannot be selected. Array elements can only be selected using an integer index. Please see https://aka.ms/logicexpressions for usage details.'.
 
 
Any advice?
Thanks
 
 
Categories:
I have the same question (0)
  • Expiscornovus Profile Picture
    33,737 Most Valuable Professional on at
    Afaik you cannot use the equals directly in an expression like that. It would need a reference to a specific item of the 'value' list of items. However, in your case you want to filter to check all items and not a specific item. My suggestion would be to use an Filter Array instead.
     
    Try and add a filter array action in between the Get Items and Compose.
     
    first(body('Filter_array'))['PrincipleID']
     
    Btw, you can also filter directly in the Get Items. But I assume you don't want that, because you mentioned in your opening post you wanted to retrieve all items first?
     
    In that case the expression would be:
    first(outputs('Get_items')?['body/value'])['PrincipleID']
     
     
  • johnjohnPter Profile Picture
    1,837 Season of Giving Solutions 2025 on at
     
    Thanks for the reply. But i do not want to only get the item with Title = Admin? i want to do this for all the others 15 items. and i do not want to end up having to define 15 separate FilterArray actions.. as this will force my flow to make additional Requests which i am trying to avoid.. that why i am asking how to get all items using single action (GetItems), then filter the items based on the title using formulas ... title can be 'Admin' in other cases it can be 'IT-Admin' , and so on..? Is this possible?
  • Expiscornovus Profile Picture
    33,737 Most Valuable Professional on at
    Yes, you are right. Having so many Filter Array actions would be messy.
     
    In my first reply I forgot about xpath, so we could use that. Apologies that I didn't think of that in my first reply 😅
     
    Try the below in your Compose
    join(xpath(xml(json(concat('{"root": { value:', outputs('Get_items')?['body/value'], '}}'))), '//value[Title="Admin"]/PrincipleID/text()'), '')
     
  • johnjohnPter Profile Picture
    1,837 Season of Giving Solutions 2025 on at
     
    Wonderful it worked well for me, this is exactly what i were looking for.
     
    Thanks
  • johnjohnPter Profile Picture
    1,837 Season of Giving Solutions 2025 on at
     
    I am not sure why whenever i check "Does this answer your question?" checkbox, it got unchecked when i do a refresh .. but yuor reply is a valid answer..
  • Expiscornovus Profile Picture
    33,737 Most Valuable Professional on at
    That is strange, might be a new forum bug? I will see if I can reproduce this behaviour.
     
    As long as my earlier reply helped you out, that is the most important thing 😁

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!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 77 Super User 2026 Season 1

#2
Haque Profile Picture

Haque 68

#3
Expiscornovus Profile Picture

Expiscornovus 56 Most Valuable Professional

Last 30 days Overall leaderboard