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
)
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.
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
)
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 ?
@WarrenBelz the classic Text is not working. Text is not recognized. Also removing the trim is not making any difference.
Try a Classic Text Input (you will need .Text instead of .Value) and get rid of Trim. What you have should work.
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
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.
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
I need to know your logic (or rules) of the combination - the and/or needs to be properly bracketed.
WarrenBelz
146,524
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,906
Most Valuable Professional