Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Unanswered

Filter not working

(0) ShareShare
ReportReport
Posted on by 32

I have 2 problems:
1- In the following formula only the search with the Ticket is working, if I eliminate the formula " || Ticket = Value(TextInputSearch.Value)", then SartWith works. But they don't both work at the same time.

2- The second problem is that the filters that use the combo box do not work together, only separately. For example, if the Status filter is used the Project number filter will not work

 

Full Code:

 

SortByColumns(
Filter(
CreateRecords,
StartsWith(
Description,
Trim(TextInputSearch.Value)
) || Ticket = Value(TextInputSearch.Value)
&& (Status = FilterComboBox_Status.Selected.Status || FilterComboBox_Status.Selected.Status = Blank()) && ('Project Number' = FilterComboBox_Project.Selected.ProjectNumber || FilterComboBox_Project.Selected.ProjectNumber = Blank())
),
"Ticket",
SortOrder.Descending
)

  • WarrenBelz Profile Picture
    146,524 Most Valuable Professional on at
    Re: Filter not working

    @albertocapm ,

    That is correct - you cannot use StartsWith on an Number, however you were not doing this as you had

    Ticket = Value(TextInputSearch.Value)

    We are going to need to finalise this shortly - this is a simple filter.

  • albertocapm Profile Picture
    32 on at
    Re: Filter not working

    @WarrenBelz

    I have made several tests, and I find out that the filter is working with all the columns (only if the column is text), but when I use a number is when I am having the issue.

    For example. I change the code and if I don't filter based on Ticket Column (number) is working. When I add into the filter the Ticket Column (number), then filter stop working.

     

    Working Code:

    SortByColumns(
    Filter(
    CreateRecords,
    (
    StartsWith(
    Description,
    Trim(TextInputSearch.Value)
    ) ||
    StartsWith(
    'Project Number',
    Trim(TextInputSearch.Value)
    ) ||
    StartsWith(
    Tool,
    Trim(TextInputSearch.Value)
    )
    ) &&
    (
    Status = FilterComboBox_Status.Selected.Status ||
    FilterComboBox_Status.Selected.Status = Blank()
    )
    ),
    "Ticket",
    SortOrder.Descending
    )

  • WarrenBelz Profile Picture
    146,524 Most Valuable Professional on at
    Re: Filter not working

    @albertocapm ,

    A Classic Text Input has the output of .Text, so I am not sure that you have there. I am not sure where to go from here as what you have simply should work with the parameters you have confirmed. If you put this into a Gallery Items

    Filter(
     CreateRecords,
     (
     StartsWith(
     Description,
     TextInputSearch.Value
     )
     )
    )

    do you find the records you expect ?

     

  • albertocapm Profile Picture
    32 on at
    Re: Filter not working

    @WarrenBelz the classic Text is not working. Text is not recognized. Also removing the trim is not making any difference. 

  • WarrenBelz Profile Picture
    146,524 Most Valuable Professional on at
    Re: Filter not working

    @albertocapm ,

    Try a Classic Text Input (you will need .Text instead of .Value) and get rid of Trim. What you have should work.

  • albertocapm Profile Picture
    32 on at
    Re: Filter not working

    @WarrenBelz 

    This is correct, that is the logic. The problem is that is not working. When I am trying to filter using a number (ticket) is working, but when I type a text is not working.

    For comboBox, if I filter project Number is working. If I filter Status, is working. But if a try to filter Project number, and then filter Status I get nothing

  • WarrenBelz Profile Picture
    146,524 Most Valuable Professional on at
    Re: Filter not working

    @albertocapm ,

    I am still not totally clear - you cannot have AND and OR - it needs to be one or the other - what I posted earlier

    SortByColumns(
     Filter(
     CreateRecords,
     (
     StartsWith(
     Description,
     Trim(TextInputSearch.Value)
     ) || 
     Ticket = Value(TextInputSearch.Value)
     ) && 
     (
     Status = FilterComboBox_Status.Selected.Status || 
     FilterComboBox_Status.Selected.Status = Blank()
     ) && 
     (
     'Project Number' = FilterComboBox_Project.Selected.ProjectNumber || 
     FilterComboBox_Project.Selected.ProjectNumber = Blank()
     )
     ),
     "Ticket",
     SortOrder.Descending
    )

    has the filter logic (Description OR Ticket ) AND Status AND 'Project Number'
    So firstly anything matching EITHER Description OR Ticket is included THEN this is resulting data set is further filtered by matching Status THEN this is further filtered by matching 'Project Number'.
    Please have a think about what you want and describe it in terms of the sentence above.
    I will be offline now due to time zone, but will pick up your response int he morning.

     

  • albertocapm Profile Picture
    32 on at
    Re: Filter not working

    @WarrenBelz 

    I hope I explain correctly (As you can see I am new is this):

    When using the "TextInputSearch" it must be an OR, it is searched by the Description column or it is searched by the Ticket column

    When ComboBoxes are used, it must be AND and OR. You could search only using one combo box or you could filter using multiple combo boxes but always starting from the first selection. For example, first I filter using Project Number and then I filter only the Status "In progress" from the Status column based in the previous project number selected

  • WarrenBelz Profile Picture
    146,524 Most Valuable Professional on at
    Re: Filter not working

    @albertocapm ,

    I need to know your logic (or rules) of the combination - the and/or needs to be properly bracketed.

  • albertocapm Profile Picture
    32 on at
    Re: Filter not working

    @WarrenBelz a combination will be perfect

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,524 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,906 Most Valuable Professional

Leaderboard