I have tried to create an app from a datasource (SP list). However, app doesn't show any records in the gallery. The formula in the gallery items property is SortByColumns(Filter([@'Project Initiation'], StartsWith(Title, TextSearchBox1.Text)), "Title", If(SortDescending1, Descending, Ascending)) . However, when the search field is blank, the gallery doesn't return any items. Thoughts?
When the text input ISBLANK a condition of True will show all records. Make this small change to your code.
SortByColumns(
Filter(
[@'Project Initiation'],
If(IsBlank(TextSearchBox1.Text),True,StartsWith(Title, TextSearchBox1.Text))
),
"Title",
If(SortDescending1, Descending, Ascending)
)
---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."
Hello,
The formula is expecting a result to be in the search box. You can check to see if the search text is blank. If it is then simply return all the results and if not use the formula you have.
Regards
Ben
I made the change and still get errors.
Hi,
I would separate the formula out so that it is easier to read and see the errors. So:
If(IsBlank(TextInput1.Text),
SortByColumns([@'Project Initiation'],"Title", If(SortDescending1, Descending, Ascending)) ,
SortByColumns(Filter([@'Project Initiation'], StartsWith(Title, TextSearchBox1.Text)), "Title", If(SortDescending1, Descending, Ascending)))
That helped, but now I get...
Hello,
Someone with the same problem of the Lookups asked here and a solution has been given. Would be worth checking if you have the same situation.
User | Count |
---|---|
252 | |
106 | |
95 | |
50 | |
39 |