I'm new to PowerApps so please be patient. 🙂
I'm trying to figure out how to define a common Filter for a data source. Users should be able to insert some numbers (tracking IDs for parcels) so that the Gallery only shows entries containing those numbers.
So, I got at least 2 problems with this:
To start off easy I tried this for my gallery:
Filter (parcel_; StartsWith (parcel_ID_; TextSearchBox1.Text))
If I enter this formula in the items tab my data source is lost and no entries will show up (by default: items = fx parcel_).
I also tried the default tab but an error accured. "The Property is expecting record-values but this rule creates incompatible table-values." The error is shown in German so probably I translated it differently.
I don't know how to define the TextSearchBox1 at all. I browsed through all the E-Learning material but probably missed that part. Also it seems kind of outdated.
Do I even have to define anything or is it set correctly by default?
I created my App from a SharePoint data source.
If you need any further information I can probably provide some screenshots e.g.
Thank you so much for your help!
I assume that column “parcel_ID_” should be a number column. While StartsWith function expects a Text value in the left. SO I am afraid that the code you are using “Filter (parcel_; StartsWith (parcel_ID_; TextSearchBox1.Text))” won’t work.
To test this issue, I add a Gallery control on the app and add a connection to a SharePoint list. Then set the Items property of the Gallery to Filter(List2,StartsWith(Title,TextInput1.Text)). The code works fine on my side.
What do you mean by “how to define the TextSearchBox”? You could add a Text input control then rename it to TextSearchBox. More details about Text input control, please check it at here:
thanks for your reply.
I already received a message from another user. We figured out that my data source had to much entries so the filter would not work. I added an index to the column of the SharePoint - list and now it's working, kind of.
SortByColumns(Filter(parcel_; StartsWith(parcel_ID_;TextSearchBox1.Text)); "timestamp_"; If(SortDescending1; Descending; Ascending))
The only problem left is that only 100 entries are shown in the gallery without scrolling down. So I am not able to filter and find entries from 2015 e.g. I know that it's made like that to manage a good performance but that is kind of exactly what we need.
Preciso que a pesquisa seja feita com números. Como devo fazer já que "Filter (parcel_; StartsWith (parcel_ID_; TextSearchBox1.Text))" só funciona com texto?
Check out new user group experience and if you are a leader please create your group
Did you know that you can visit the Power Query Forum in Power BI and now Power Apps
Participate in the Power Virtual Agents Community Challenge
Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.
Dont miss our very own April Dunnam’s The Developer Guide to the Galaxy! Find out what the Power Platform has to offer for the traditional developer.