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

Community site session details

Session Id : PNHdMbFvgOwcL2P+kPEtCk
Power Apps - Microsoft Dataverse
Answered

Filter a single gallery on button click

Like (0) ShareShare
ReportReport
Posted on 14 Feb 2021 18:50:28 by 3

Hello,

 

I am trying to create a button to filter a Gallery by Status.

 

On Visible  - 3 Status should only be visible ; 

Not Started

Deferred

In Progress

 

I want to be able to press a button and only the Completed ones appear

 

I am following the instructions provided on this link ; 

https://powerusers.microsoft.com/t5/Microsoft-Dataverse/Filter-a-single-gallery-on-button-click-in-Dataverse-not-the/m-p/822520#M9474

 

I cannot seem to get it working. Would appreciate any insight .

 

The Gallery Item is set to 'Work Tasks'

The Status Column is Choices('Task Status')

 

Following the instructions on the link this is what I did ;

 

1 - Set the OnVisible property of the screen to:

Set(Thevar,"Not Started,Deferred,In Progress")

 

2 - Add a gallery control and set its Items property to:

Filter(Work Tasks,Text(Completed)=Thevar)

 

3 - Add a button control and set its OnSelect property to:

Set(Thevar2,!Thevar2);If(Thevar2=true,Set(Thevar,"Completed"),Set(Thevar,"Not Started,Deferred,In Progress"))

 

 

I am getting X errors on 2 and 3. What am I doing wrong? I would appreciate any help . Thank you in advance!

 

Categories:
I have the same question (0)
  • Verified answer
    EricRegnier Profile Picture
    8,714 Most Valuable Professional on 14 Feb 2021 at 20:48:05
    Re: Filter a single gallery on button click

    Hi @IchigoKun,

    You're almost on the right track. Filter expressions on Dataverse tables you'll need to reference the values instead of text. Try the following things:

    1) I don't think you need the "Thevar" variable, you can filter directly the desired on the button click

    2) Items property to. Where Completed is the name of the status field. Itellisense should kick in to pick the desired status items

    Filter(Work Tasks, Completed = Completed.'Not Started' || Completed = Completed.Deferred || Completed = Completed.'In Progress')​

    3) OnSelect of the button, set the Items property of your gallery. For ex, if the "Not Started" button is clicked then:

    Filter(Work Tasks, Completed = Completed.'Not Started')​​

    Hope this helps!

     

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

MS.Ragavendar – Community Spotlight

We are honored to recognize Ragavendar Swaminatha Subramanian as our September…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 892 Most Valuable Professional

#2
Power Apps 1919 Profile Picture

Power Apps 1919 356

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 310 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Loading complete