Hi,
I do not have the sort option in the gallery, as I purposefully removed it. I have the following formula in the Items property of the Gallery,
If(IsBlank(TextSearchBox1),'Item Master',Search(AddColumns('Item Master',"Model",'Model Number'),TextSearchBox1.Text,"Model","ItemName"))
I want to show the last item at top in the gallery like descending.
How can I do that?
Osmand
Solved! Go to Solution.
Please forgive me for asking: but why can you not use the SORT function? I would like to understand your requirement.
Sort(
If(IsBlank(TextSearchBox1),'Item Master',Search(AddColumns('Item Master',"Model",'Model
Number'),TextSearchBox1.Text,"Model","ItemName")),
ID, Descending
)
Note: my code above assumes the records were initially sorted by ID: 1, 2, 3, 4, 5...
---
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."
I want to make sure I understand your request.
Let's say you have a Gallery that looks like this:
Do I understand correctly that the solution should look like this?
---
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."
Please forgive me for asking: but why can you not use the SORT function? I would like to understand your requirement.
Sort(
If(IsBlank(TextSearchBox1),'Item Master',Search(AddColumns('Item Master',"Model",'Model
Number'),TextSearchBox1.Text,"Model","ItemName")),
ID, Descending
)
Note: my code above assumes the records were initially sorted by ID: 1, 2, 3, 4, 5...
---
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."
Hi @OsmandFernando ,
Could you please share a bit more about your scenario?
Do you want the latest item to be displayed at the top of your Gallery? Why do you not use Sort function in your app?
How many records existed in your data source? More than 2000?
Currently, if you want to display the latest item from your data source at the top of your Gallery without Sort function, I afraid that there is no direct way to achieve your needs in PowerApps currently.
As an alternative solution, I think the ForAll function and LastN function could achieve your needs. I have made a test on my side, please consider take a try with the following workaround:
Set the OnStart property of App to following:
Clear(FinalCollection);
ForAll(
[1,2,3,4,5,6,7,8,9,10,...,100,101,...., 200, 201, ...],
Collect(FinalCollection, First(LastN('Item Master', Value)))
)
Then modify your Filter formula as below:
If(
IsBlank(TextSearchBox1),
FinalCollection,
Search(
AddColumns(FinalCollection,"Model",'Model Number'),
TextSearchBox1.Text, "Model","ItemName"
)
)
then re-load your app (fire the OnStart property of the App), check if the issue is solved.
Note: Please consider set the "Data row limit for Non-delegable queries" option to maximum value -- 2000 within Advanced settings of App settings of your app.
As an direct solution, I think the Sort function or SortByColumns function could achieve your needs perfectly.
Best regards,
Dear @mdevaney your suggestion fulfilled my need. Thank you so much
@v-xida-msft Thank you for your wonderful reply too.
Osmand.
User | Count |
---|---|
252 | |
125 | |
106 | |
50 | |
49 |