Hi Power Apps Community,
I am trying to perform a Search based on the Gallery from a Collection, but have been unsuccessful.
Using the code below, I get the following error: "The specified column "Title1_1" does not exist."
Search(Source, TextSearchBox1.Text, "Title1_1")
I am not sure if it is based on how the data is stored, but below is the 'Title1_1' that I am wanting to reference for the Search.
I would really appreciate any assistance.
Thank you in advance.
Solved! Go to Solution.
Hi@Data_Enthusiast,
As I mentioned before, the Search() function needs you to directly refer to the column name from the data source. Therefore, referring to the Label name could not help you get there.
Could you please tell me how you set the Text property of the Label? (IMPORTANT!)
How you set the Label decides what to refer to within the Search() function.
Combine that with your description, you use a nested collection as the data source. The column you want to refer to could not exist in a nested collection, it will give you an error message like "The specific column does not exist..." if you refer to the column directly.
I think you should use AddColumns() function to convert the nested column into a normal column.
I have made a similar test, please take a try as below.
Add a Button and set the OnSelect property as below:
ClearCollect(nestedCollection,{Title:"Level 1A",Level2:{Title2:"Level 2A"}},{Title:"Level 1B",Level2:{Title2:"Level 2B"}})
Add another Button and set the OnSelect property as below:
Collect(temp2,AddColumns(nestedCollection,"Test",Level2.Title2))
Note: The temp2 collection will have a normal column where display the nested column item directly.
Now, you could set the Items property of the Gallery as below:
Search(temp2,TextInput3.Text,"Test")
Best Regards,
Qi
Based on the issue that you mentioned, do you want to search based on the search bar?
Could you please share a bit more about the search column, is it named "Title1_1" within your data source?
Let me explain the Search() function to you.
Search( Table, SearchString, Column1 [, Column2, ... ] )
You could see that the column should be a Text type which is only allowed. So please check:
I have made a test as below.
In my scenario, I set the Items property of the Gallery as below:
SortByColumns(Search(Test1029, TextSearchBox1.Text,"Title"), "Title", If(SortDescending1, Descending, Ascending))
Note: Title is my column name from my SP list.
Please go to your data source and check if the column that you want to search for is named "Title1_1".
Best Regards,
Qi
The data is being referenced in a Collection.
"Title1_1" is the name of the Label.
The actual 'Value' of the record is in one of these:
I tried to reference the column name: 'Field.Value' but had no luck with this either.
Hi@Data_Enthusiast,
As I mentioned before, the Search() function needs you to directly refer to the column name from the data source. Therefore, referring to the Label name could not help you get there.
Could you please tell me how you set the Text property of the Label? (IMPORTANT!)
How you set the Label decides what to refer to within the Search() function.
Combine that with your description, you use a nested collection as the data source. The column you want to refer to could not exist in a nested collection, it will give you an error message like "The specific column does not exist..." if you refer to the column directly.
I think you should use AddColumns() function to convert the nested column into a normal column.
I have made a similar test, please take a try as below.
Add a Button and set the OnSelect property as below:
ClearCollect(nestedCollection,{Title:"Level 1A",Level2:{Title2:"Level 2A"}},{Title:"Level 1B",Level2:{Title2:"Level 2B"}})
Add another Button and set the OnSelect property as below:
Collect(temp2,AddColumns(nestedCollection,"Test",Level2.Title2))
Note: The temp2 collection will have a normal column where display the nested column item directly.
Now, you could set the Items property of the Gallery as below:
Search(temp2,TextInput3.Text,"Test")
Best Regards,
Qi
Thank you! This worked for me 🙂
I have picked up quite a strange issue, but I will create a new post for that as this post has been answered.
Thank you again.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.
User | Count |
---|---|
194 | |
67 | |
46 | |
42 | |
22 |
User | Count |
---|---|
246 | |
120 | |
82 | |
74 | |
69 |