I have a gallery filter with items = SortByColumns(Filter(Clients, StartsWith(Title,TextSearchBox1.Text)), "Title", If(SortDescending1, Descending, Ascending))
the above is working and it gives me all the projects but now I need to add a toggle filter so that from the above result I filter again if the projects are assigned.
can you help me on how to do it please ?
thanks
Solved! Go to Solution.
You mentioned that you want the second filter to be triggered by a toggle control. Does this mean that you want to search by "client code" when the toggle is ON and search by "assigned to" when the toggle is OFF? It is still not clear how are you planning to provide the search strings (the client code and the assigned to search values you want to filter by).
I would like to understand the intended behavior.
no, let's forget the toggle. can i search for client name, client code or assigned to from the same search box ?
Yes. You can add multiple search/filter criterias. Please try the following:
SortByColumns(Filter(Clients, StartsWith(Title,TextSearchBox1.Text) Or StartsWith(Assigned_To,TextSearchBox1.Text) Or StartsWith(ClientCode,TextSearchBox1.Text)), "Title", If(SortDescending1, Descending, Ascending))
Note that the formula above will find records where Title, AssignedTo or ClicnetCode starts with a value provided in the TextInput. If you prefer to find records where Title, AssignedTo or ClientCode contain the search value (as opposed to starts with) then your formula will be:
SortByColumns(Filter(Clients, TextSearchBox1.Text in Title Or TextSearchBox1.Text in Assigned_To Or TextSearchBox1.Text in ClientCode), "Title", If(SortDescending1, Descending, Ascending))
Note the "in" operator which allows you to find the records.
Hi there,
Similar issue which I can't figure out.
I am trying to Filter or StartWith "Not assigned" once toggle= true
SortByColumns(Filter('Titan Asset List', If(Toggle1.Value=true, StartsWith(Status.Value="Not assigned",TextSearchBox1.Text), StartsWith(Asset_x0020_number,TextSearchBox1.Text))), "Asset_x0020_number", If(SortDescending1,Descending,Ascending))
Thanks in advance
This is not going to work for you...Your StartsWith is not specifying a column but rather a condition (Status.Value="Not assigned") - it needs to be a column.
SortByColumns(
Filter('Titan Asset List',
If(Toggle1.Value,
StartsWith(Status.Value="Not assigned",TextSearchBox1.Text),
StartsWith(Asset_x0020_number,TextSearchBox1.Text))
),
"Asset_x0020_number",
If(SortDescending1,Descending,Ascending)
)
If you are trying to Filter for the "Not assigned" when the Toggle is true, then perhaps consider this:
SortByColumns(
Filter('Titan Asset List',
If(Toggle1.Value, StartsWith(Status.Value, "Not assigned"), true) &&
StartsWith(Asset_x0020_number,TextSearchBox1.Text)
),
"Asset_x0020_number", If(SortDescending1,Descending,Ascending)
)
Hi RandyHayes,
Works very well thank you very much.
However, sorting it ascending, descending by Asset Number doesnt work as it should, please see pics attached.
I would like togle to filter out Not assigned asset numbers and Sort asseets lowest to highest and versa.
Thanks
Very good.
For the sorting - but pictures looked like the asset number was sorted. I'm not sure what the problem is with what you have in the pictures.
However, if you're having issues with sorting, I would have to ask - what is SortDescending1 ? I had assumed in the response that it was just a variable, but if it is something else, then perhaps that is where you are having sort issues.
So, if you are trying to filter out Not Assigned, then that second example I gave you should do the trick.
Hope that helps some.
Hi RandyHayes,
Asset numbers are not being sorted in lowest to highest number note: 00003 is missing some of the assets ar found at random placed.
IconSortUpDown1
OnSelect: UpdateContext({SortDescending1: !SortDescending1})
Thanks
@Minde23 Everything looks good in what you are doing.
Are you sure the actual data is as you expect? What if you sort the list in SharePoint directly...what happens with asset 00003? How does asset 00003 meet the filter criteria - or does it?
User | Count |
---|---|
188 | |
125 | |
91 | |
47 | |
42 |
User | Count |
---|---|
271 | |
161 | |
132 | |
83 | |
78 |