Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

Filtering out records with certain values.

Posted on by 223

Hello,

 

With the help of @Drrickryp and the following formula i was able to filter my Data table by a search box and drop down. 

Link to past post: https://powerusers.microsoft.com/t5/Building-Power-Apps/Data-Table-Filtering-with-search-field-and-Dropdown/m-p/869312#M276267https://powerusers.microsoft.com/t5/Building-Power-Apps/Data-Table-Filtering-with-search-field-and-Dropdown/m-p/869312#M276267

 

Sort(
 Filter(
 'Expense App List New',IsBlank(Tech_Name_Search_TextInput1.Text)||
 StartsWith(RequestedBy,Tech_Name_Search_TextInput1.Text),
 IsBlank(Filter_Item_Status_Dropdown1.Selected.Value)||
 ItemStatus = Filter_Item_Status_Dropdown1.Selected.Value
 ),
 RequestedBy,Ascending
)

 

 

My question now is can I add a filter to exclude and not show any records where the value in ItemStatus is "Complete".

 

Then I want to duplicate the data table for another screen and show only records where the ItemStatus is "Complete".

Categories:
  • Chrisguff12 Profile Picture
    Chrisguff12 223 on at
    Re: Filtering out records with certain values.

    @WarrenBelz 

     

    Thank you for helping me and not giving up.  This new formula is working great. 

  • Verified answer
    WarrenBelz Profile Picture
    WarrenBelz 143,487 on at
    Re: Filtering out records with certain values.

    @Chrisguff12 ,

    That formula syntax is correct, but you said right at the start this was working

    Sort(
     Filter(
     'Expense App List New',
     IsBlank(Tech_Name_Search_TextInput1.Text)||
     StartsWith(RequestedBy,Tech_Name_Search_TextInput1.Text),
     IsBlank(Filter_Item_Status_Dropdown1.Selected.Value)||
     ItemStatus = Filter_Item_Status_Dropdown1.Selected.Value
     ),
     RequestedBy,
     Ascending
    )

    I use a slightly different bracketing and operator version (and I use the structure a lot), but keeping to the above

    With(
     {
     wActive:
     Filter(
     'Expense App List New',
     ItemStatus = "Delivered" ||
     ItemStatus = "Missing" ||
     ItemStatus = "Ordered" ||
     ItemStatus = "Pending" ||
     ItemStatus = "Received" ||
     ItemStatus = "Returned" ||
     ItemStatus = "Reviewing"
     )
     },
     Sort(
     Filter(
     wActive,
     IsBlank(Tech_Name_Search_TextInput1.Text)||
     StartsWith(RequestedBy,Tech_Name_Search_TextInput1.Text),
     IsBlank(Filter_Item_Status_Dropdown1.Selected.Value)||
     ItemStatus = Filter_Item_Status_Dropdown1.Selected.Value
     ),
     RequestedBy,
     Ascending
     )
    )

    does this work for you?

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • Chrisguff12 Profile Picture
    Chrisguff12 223 on at
    Re: Filtering out records with certain values.

    @WarrenBelz 

     

    Its still not working. The formula is working and the Complete records no long showing up. but the Item status Dropdown wont sort the table if the search box is blank. Then when you type a name (Chris) into the search box the table shows the the correct item status but also all of the users and not just the ones starting with the text that was entered.  

  • WarrenBelz Profile Picture
    WarrenBelz 143,487 on at
    Re: Filtering out records with certain values.

    Hi @Chrisguff12 ,

    Just checking if you got the result you were looking for on this thread. Happy to help further if not.

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • WarrenBelz Profile Picture
    WarrenBelz 143,487 on at
    Re: Filtering out records with certain values.

    Thanks @Chrisguff12 ,

    The key here is that you want to filter by all the "other" values other than approved - try this (the "long way" is to make it Delegable)

    With(
     {
     wActive:
     Filter(
     'Expense App List New',
     ItemStatus = "Delivered" ||
     ItemStatus = "Missing" ||
     ItemStatus = "Ordered" ||
     ItemStatus = "Pending" ||
     ItemStatus = "Received" ||
     ItemStatus = "Returned" ||
     ItemStatus = "Reviewing"
     )
     },
     Sort(
     Filter(
     wActive,
     (
     IsBlank(Tech_Name_Search_TextInput1.Text)||
     StartsWith(RequestedBy,Tech_Name_Search_TextInput1.Text
     ) && 
     IsBlank(Filter_Item_Status_Dropdown1.Selected.Value)||
     ItemStatus = Filter_Item_Status_Dropdown1.Selected.Value
     )
     ),
     RequestedBy	 
     )
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • Chrisguff12 Profile Picture
    Chrisguff12 223 on at
    Re: Filtering out records with certain values.

    @WarrenBelz ,

     

    I’m Sorry for the confusion and Thanks for your patience.  I’m not trying to restrict items shown in the dropdown.

     

    Ill show you what is happening.  

     

    This data table will display all records and their status as a standard. With NO filters applied. The users wont even have an option to set a filer to show the Completed. They will select the Complete Request button to take them to a different screen and view the completed requests.

    Chrisguff12_0-1617141609535.png

    Your Formula works to take out the records with the “Complete” status. (Below).

    Chrisguff12_1-1617141628486.png

     

    But in doing so the search and dropdown filters no longer work right. Here are the examples. Green is the results from my current Formula, the Red is the results with your formula.

     

     

    Searching by just the dropdown. The Red is still showing all the records.

    Chrisguff12_2-1617141665315.png

    Chrisguff12_3-1617141675683.png

     

    Filtering by name only works just fine.

    Chrisguff12_4-1617141701891.png

    Chrisguff12_5-1617141701903.png

     

    Filtering by both. The Red filters by Status just fine, but it is showing all the users regardless of what I type in.

    Chrisguff12_6-1617141765750.png

    Chrisguff12_7-1617141775947.png

     

     

     

  • WarrenBelz Profile Picture
    WarrenBelz 143,487 on at
    Re: Filtering out records with certain values.

    @Chrisguff12 ,

    We are going in circles here a bit - the problem is you know what you want, but I cannot see your data) or read your mind). You have two filters, one for RequestedBy (a Text box) and the other for ItemStatus (a drop-down).

    Are you trying to restrict the items shown in the drop-down (which you are already filtering on)?

  • Chrisguff12 Profile Picture
    Chrisguff12 223 on at
    Re: Filtering out records with certain values.

    @WarrenBelz 

    For the "Current Requests" Table I don't want them to show Complete at all. but the status dropdown will still have to filter the other options like Approved, pending, ordered, etc. 

  • WarrenBelz Profile Picture
    WarrenBelz 143,487 on at
    Re: Filtering out records with certain values.

    @Chrisguff12 ,

    If they are all complete, you do not need the last filter (ItemStatus="Complete").

    As I asked previously, when do you / do you not want to filter on Item Status - you will need some sort of a switch to change the Filter accordingly.

  • Chrisguff12 Profile Picture
    Chrisguff12 223 on at
    Re: Filtering out records with certain values.

    @WarrenBelz 

     

    There are two data tables "Current Requests" and "Complete requests".

     

    The Current requests table will show all records that are not complete. These will need to be able to be filtered by the search box and/or StatusDropdown.

     

    The Complete table will only have the complete records. This one will only need to be filtered by the search box cause all records will have the Complete status. 

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

November 2024 Newsletter…

November 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #7 Community Profile Tips…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 143,487

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 64,014

Leaderboard