My app currently searches the "Title" field but I want it to also search the "ID" field. The function is listed below.
SortByColumns(Filter('New DXC SharePoint Pursuit Site Request Form', StartsWith(Title, TextSearchBox1.Text)), "Title", If(SortDescending1, Descending, Ascending))
How would I modify this to also allow searches for "ID"?
Solved! Go to Solution.
Thanks, @Drrickryp for the reply. When I tried your code, I got the following error: "Incompatible type. We can't evaluate your formula because the values being compared in the formula aren't the same type. The left value is a Text type and the right value is a Number type".
SortByColumns(Filter('New DXC SharePoint Pursuit Site Request Form', 'SFDC ID'=Value(Textsearchbox1.Text)), "Title", If(SortDescending1, Descending, Ascending))
The error message "The left value is a Text type and the right value is a Number type" is puzzling since both fields from the SP list are single line text fields (i.e., both text data type). Any recommendations are greatly appreciated.
Change the formula removing the Value() function. I'm surprised your ID is text and not a number.
SortByColumns(Filter('New DXC SharePoint Pursuit Site Request Form', 'SFDC ID'=Textsearchbox1.Text), "Title", If(SortDescending1, Descending, Ascending))
The 'SFDC ID' field is a text field, not a numeric field since it contains alphanumeric characters. Unfortunately, when I tried the new code, all the items are missing like they've been filtered out.
I finally got it working. This code is attached to the gallery and uses a filter to look for either Title or SFDC ID. It also performs a default, ascending sort on Title.
SortByColumns(Filter('New DXC SharePoint Pursuit Site Request Form', StartsWith(Title,TextSearchBox1.Text)||StartsWith('SFDC ID',TextSearchBox1.Text)), "Title", If(SortDescending1, Descending, Ascending))
Thanks to everyone who responded as I could not have arrived at this solution with your help.
Check out new user group experience and if you are a leader please create your group
Did you miss the call?? Check out the Power Apps Community Call here!
See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.
User | Count |
---|---|
257 | |
251 | |
84 | |
36 | |
32 |
User | Count |
---|---|
339 | |
265 | |
123 | |
72 | |
46 |