I have the below code:
SortByColumns(Search('To Do List', TextSearchBox1.Text, "Title"), "ID", If(SortDescending1, Descending, Ascending))
I need the gallery not to display results from the sharepoint data sorce that comply with the status "Completed" Ive read a few other posts but struggling to mix the code in with mine. Tom
Solved! Go to Solution.
Ah, if your sharepoint column is named "Status", and (it seems to be) of type choice, then the expression should reference that column name, something along the lines of
SortByColumns( Search( Filter('To Do List', Status.Value <> "Completed"), TextSearchBox1.Text, "Title"), "ID", If(SortDescending1, Descending, Ascending))
You would use the Filter function in this scenario:
SortByColumns( Filter( Search('To Do List', TextSearchBox1.Text, "Title"), Completed = false), "ID", If(SortDescending1, Descending, Ascending))
Expressions in PowerApps can be nested, so in the example above you're filtering the result of the Search operation based on the condition that you want.
Hi Carlos,
Is it possible to only show items in the gallery were completed is false, before the search is run
Sure, both Search and Filter functions "filter" the rows that are returned by the data source, without changing its "shape", so their order can be flipped, and the results should be the same:
SortByColumns( Search( Filter('To Do List', Completed = false), TextSearchBox1.Text, "Title"), "ID", If(SortDescending1, Descending, Ascending))
Thanks, altough how does it know what colum to look in for the "Completed status"? This is the sharepoint form
No results are being retunred?
Thank you for your help, its much appreciated
Ah, if your sharepoint column is named "Status", and (it seems to be) of type choice, then the expression should reference that column name, something along the lines of
SortByColumns( Search( Filter('To Do List', Status.Value <> "Completed"), TextSearchBox1.Text, "Title"), "ID", If(SortDescending1, Descending, Ascending))
User | Count |
---|---|
184 | |
123 | |
90 | |
45 | |
42 |
User | Count |
---|---|
267 | |
160 | |
128 | |
81 | |
76 |