Hi,
I am hoping someone can help me with a problem I am having:
I have a gallery in PowerApps. The data source is a SharePoint List (OOSListAT).
Now I want to filter this after a yes/no choice field called "Closed". The comman I used under items for this was the following (and it worked):
Filter(OOSListAT,Closed.Value = "no")
Now I also want to add a function to sort the displayed value. The following code I used also worked:
SortByColumns(AddColumns(OOSListAT,"Product2",Product_x0020_Presentation.Value),"Product2",If(SortDescending1,Descending,Ascending))
The column "Product_x0020_Presentation" is a look-up field in the sharpoint list.
Now I want to combine those two functions, but I can't seem to get it to work.
Also I would really like to add the function to search the gallery because there will be more than one entry for example for ProductA. So I want the option to enter 'ProductA' in the search bar and get all entries for this product. Is this possible?
This is how my app looks at the moment (the search bar doesn't yet work).
Can anyone help me with that?
Thank you in advance!
Solved! Go to Solution.
Hi @christina_hoeg ,
Could you please share a bit more about your scenario?
Do you want to filter your Gallery Items based on the "Closed" field and TextSearchbox, and then sort it by a specific column?
I have made a test on my side, please consider take a try with the following workaround:
Set the Items property of the Gallery to following:
SortByColumns(
Filter(
AddColumns(OOSListAT, "Product2", Product_x0020_Presentation.Value),
Closed.Value = "no",
StartsWith(Product2, TextSearchBox1.Text)
),
"Product2",
If(SortDescending1,Descending,Ascending)
)
or
SortByColumns(
Filter(
AddColumns(OOSListAT, "Product2", Product_x0020_Presentation.Value),
Closed.Value = "no",
TextSearchBox1.Text in Product2
),
"Product2",
If(SortDescending1,Descending,Ascending)
)
Please consider take a try with above solution, then check if the issue is solved.
Best regards,
The order to combine those would go like this:
SortByColumns(
Filter(
Search(
AddColumns(DataSource,"ColumnName","ColumnSource"),
input_SearchText.Text, "ColumnSearch1","ColumnsSearch2"),
ColumnFilter="Description"),
"ColumnSort", If(SortDescending1, Descending,Ascending))
Hi @christina_hoeg ,
Could you please share a bit more about your scenario?
Do you want to filter your Gallery Items based on the "Closed" field and TextSearchbox, and then sort it by a specific column?
I have made a test on my side, please consider take a try with the following workaround:
Set the Items property of the Gallery to following:
SortByColumns(
Filter(
AddColumns(OOSListAT, "Product2", Product_x0020_Presentation.Value),
Closed.Value = "no",
StartsWith(Product2, TextSearchBox1.Text)
),
"Product2",
If(SortDescending1,Descending,Ascending)
)
or
SortByColumns(
Filter(
AddColumns(OOSListAT, "Product2", Product_x0020_Presentation.Value),
Closed.Value = "no",
TextSearchBox1.Text in Product2
),
"Product2",
If(SortDescending1,Descending,Ascending)
)
Please consider take a try with above solution, then check if the issue is solved.
Best regards,
@v-xida-msft thank you so much for you help! the second option was exactly what I needed!
Stay up tp date on the latest blogs and activities in the community News & Announcements.
Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.
User | Count |
---|---|
213 | |
198 | |
83 | |
59 | |
38 |