Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Can't Get "Get Items" Filter to Work for Choice Field

(0) ShareShare
ReportReport
Posted on by

Hello Community!

 

I'm working with Power Automate, and I need to create a "Get Items" action that filters on a choice field.  First, I capture the current items Choice selection in a variable:

 

tsmolskow_0-1717794230618.png

 

Then I try to use that variable as a filter:

 

tsmolskow_1-1717794474105.png

 

But unfortunately, I get errors like this: 

     The expression "Enterprise SharePoint (it/sp) eq Enterprise SharePoint (it/sp)" is not valid. Creating query failed.

 

When I look at this comparison, I think it's a match.  Has anyone else seen and solved this problem? If you have, please share the way to solve it along with examples.

 

Thanks!

 

Tom

 

 

 

  • Verified answer
    creativeopinion Profile Picture
    10,450 Super User 2025 Season 1 on at
    Re: Can't Get "Get Items" Filter to Work for Choice Field

    @tsmolskow You are missing single quotes around your variable. I also don't think using a variable is necessary in your case. Whenever you are using strings in the Filter Query field, you need to ensure you wrap your string in single quotes.

     

    Hope this helps!

    If I helped you solve your problem—please mark my post as a solution ✅.
    Consider giving me a 👍 if you liked my response!

    👉 Level up your Power Automate skills by checking out my tutorials on YouTube
    👉 Tips and Tricks on TikTok and Instagram
  • tsmolskow Profile Picture
    on at
    Re: Can't Get "Get Items" Filter to Work for Choice Field

    Hey A Creative Opinion,

     

    Thank you for your advice, and I certainly will try out your trick with the Compose Action.  Unfortunately, after adding the field name to my Query Filter, I still get an error message.  Here is the query setting:

    tsmolskow_0-1718028346176.png

    Here is the error:

    The expression "field_3 eq Information Technology (it)" is not valid. Creating query failed.

     

    I thought the parathesis might be the problem, so I tried this code in both a variable to hold the edited items value and the filter comparison value, but it still errors out.

    replace(replace(replace(triggerBody()?['field_3']?['Value'],'(',''),')',''),'/','')

     

    Any thoughts?
     

  • creativeopinion Profile Picture
    10,450 Super User 2025 Season 1 on at
    Re: Can't Get "Get Items" Filter to Work for Choice Field

    @tsmolskow Your filter query is incorrect. You need to include the internal column name of your Choice column. Keep in mind that the internal column name may not always match the column name displayed in your Sharepoint list. If you aren't sure how to get the Internal Column name, you can refer to this section of one of my YT Tutorials.

     

    Not sure how to write a filter query? Check out this YT short.

     

    If you have more than 100 items in your SP list, you will need to toggle on pagination and set a threshold. The Get Items action returns 100 items per call by default, if you want more items returned per call you'll need to toggle on pagination and set a threshold. The threshold max is 5000. 

    creativeopinion_0-1717814871969.png

     

     

    creativeopinion_1-1717814871911.png

     

    Additionally, whenever I use a Filter Query in a Get Items action, I always like to return the count of items returned in a Compose action. This is helpful when building a flow and can also be used to troubleshoot your flow.

    Insert a Compose action. Add an Expression. Use the length() function.

    creativeopinion_2-1717814960487.png

     

    Select the Dynamic content tab and insert the value dynamic content from the Get Items action into the length() function.

    creativeopinion_3-1717814984004.png

     

    Run a test.

     

    Hope this helps!

    If I helped you solve your problem—please mark my post as a solution ✅.
    Consider giving me a 👍 if you liked my response!

    👉 Level up your Power Automate skills by checking out my tutorials on YouTube
    👉 Tips and Tricks on TikTok and Instagram

     

  • R2D2CS Profile Picture
    9 on at
    Re: Can't Get "Get Items" Filter to Work for Choice Field

    Its been a long time since I've done it and I don't have any sharepoint lists to test with but I "think" you need to put the field3.value dynamic content in 'single quotes'

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1