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 Apps / Filtering Gallery Base...
Power Apps
Unanswered

Filtering Gallery Based on OptionSet Values

(0) ShareShare
ReportReport
Posted on by 377

Hello All,

 

I have a Gallery pointing to a CDS Entity called 'Declarations'. It has a custom field called 'Status' which is an OptionSet.  I am struggling to set  a Filter property on the Gallery to display ONLY statuses of 'New' Declarations.

 

I have tried all combinations of single quotes and double quotes, field names etc.   There are no other complications other then just displaying ONLY 'New' declarations in the Gallery when the form loads.  But I keep getting errors at the '=' sign, as well as on the right side of the =sign. 

 

Items= Filter(Declarations, 'Status (cr70c_status)'=[@'Status (cr70c_status)'].New)

 

Please let me know what the correct syntax is. Thanks!

Categories:
I have the same question (0)
  • Vijay Tailor Profile Picture
    2,961 on at

    Hi @rprahalad ,

    Below is the ways to filter the record based on Optionset.

    Filter(TestAkshay,Complexity.Value="New/Pending")


    Thanks,
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

     

  • rprahalad Profile Picture
    377 on at

    Ah! I finally got it right. It is

    Filter(Declarations, 'Status (cr70c_status)' = [@'Status'].New)

  • rprahalad Profile Picture
    377 on at

    Thanks Vijay! In my case the column name of 'Status', which I think is also the name of a key column, was giving me an issue. But appreciate your help. 

  • rprahalad Profile Picture
    377 on at

    I tried your syntax  but it is giving me a red squiggly at the .Value. The error is: 'Name isn't valid. This Identifier isn't recognized.'. 

     

    Filter(Declarations, 'Status (cr70c_status)'.Value = "New")

  • Verified answer
    Vijay Tailor Profile Picture
    2,961 on at

    Hi @rprahalad ,

    Please try like below, As previously i mentioned that will according to Sharepoint.

    But below is the CDS ways to Filter Gallery based on Optionset

    Filter(
     VOJOBS,
     If(
     Dropdown1.Selected.Value = "Completed",
     'Field Status' = [@'Field Status'].Completed,
     Dropdown1.Selected.Value = "InCompleted",
     'Field Status' = [@'Field Status'].InCompleted
     )
    )

    .
    Hope that will help you.
    Thanks

  • rprahalad Profile Picture
    377 on at

    Vijai, I will mark this as an Answer as this syntax from your reply above,  also worked for me! Thanks!  

     

    Filter(Declarations, 'Status (cr70c_status)'=Status.New)

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 Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard