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 Apps / Filter when clicking t...
Power Apps
Answered

Filter when clicking the respective fields showing each status value in data table

(0) ShareShare
ReportReport
Posted on by 13

Hey everyone, I need your help please. I would like to see when I click on the whole "New" field in the data table all sharepoint entries that have only the status "New". If I click "in progress" then of course only "in progress" entries and so on. With "All" then all fields. Would this be possible? That would be great.
Thanks a lot.

 

Tikuno_0-1640262733283.png

 

Categories:
  • dgatewood Profile Picture
    34 on at

    There's a couple of approaches. Primarily if you are going to filter SharePoint by your status you will want to make sure to use Filter(listname, StartsWith('Status', "In progress"). You could set a variable for all your status, Set(varStatus, 1) for new button Set(varStatus, 2) for in progress etc. Then do filter with switch Filter(listname, Switch( varStatus = 1, StartsWith('Status', "new", varStatus =2, StartsWith('Status', "In progress")) etc

  • Mike2500 Profile Picture
    1,247 Super User 2024 Season 1 on at

    This is the old "how do I take an action when I click on a button in Power Apps" question. Everyone struggles with this when they get started, and the solution is that we need to think more like excel, and less like other programming environments. 

     

    The button click won't filter the gallery, instead let's set the "new" button to set a variable that contains the value "new", the "in progress" button will set that same variable to have the value "in progress", etc. Then, we can set the gallery to use that variable as part of its filter.

     

    So the new button will have:

    UpdateContext({varStatus:"New"})

     

    And the gallery can have the following as its items property:

    Filter(tablename,Status=varStatus)

     

    IF your status field is a choice field in sharepoint, we'll need to take that into account to reference the value of the choice field:

    Filter(tablename,Status.Value=varStatus)

     

     

     

     

     

     

     

  • dgatewood Profile Picture
    34 on at
    I also recommend Reza Dorrani's filter pane YouTube video.
  • dgatewood Profile Picture
    34 on at
    I also recommend Reza Dorrani's filter pane YouTube video.
  • Tikuno Profile Picture
    13 on at

    Thanks a lot.

     

    I just have Rectangles to click on without any buttons it works, but not consistently right now hope I can fix it somehow. it depends where exactly I click but I wanna have it for the whole field.

    nvm I did fix this. 🙂

     

    All statuses works right now but how should I add the status "All"? I mean I could count all rows for the all one, right? I added this one just need to extend it somehow for the all one.

     

    Filter(tablename,Status.Value=varStatus)

     

  • Verified answer
    Mike2500 Profile Picture
    1,247 Super User 2024 Season 1 on at

    There's a few ways of doing this. One is to have the all button set the filter variable to Blank():

    UpdateContext({varStatus:Blank()})

     

    And then have a condition in the gallery that only uses the filter if the variable isn't blank:

    If(IsBlank(varStatus),tablename,Filter(tablename,Status=varStatus))

     

     

     

     

     

  • Tikuno Profile Picture
    13 on at

    Thanks mate for quick help.

     

    Unfortunately the datatable shows me now "No elements to display" when I add that blank variable.

  • Mike2500 Profile Picture
    1,247 Super User 2024 Season 1 on at

    And you also updated the items property with the if statement? If so, please post both pieces.

  • Tikuno Profile Picture
    13 on at

    It worked now after I restarted my Power Apps. Haha.

     

    Thanks a lot.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 360 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 325

#3
Mohsin Ali Profile Picture

Mohsin Ali 232

Last 30 days Overall leaderboard