Hello,
I am working on a Location based Canvas App and have a gallery with Title and Subtitle fields that pulls data from a PowerApps collection and the Gallery is sorted in the ascending order by the Sub Title data. The Collection has 660 rows with 2 columns (Location and Distance).
Title (Location Column)
Subtitle (Distance Column)
The sort works fine for first 5 items and then it skips many records and jumps higher as shown below. In between there are many locations between 10 and 90 miles and not sorting properly
My formula is below:
With(
{
Items:
SortByColumns(
Search(
LocationData,
TextSearchBox.Text,
"Title"
),
"Distance", SortOrder.Ascending
)
},
ForAll(
Sequence(CountRows(Items)),
Patch(
Last(
FirstN(Items,Value)),
{ID: Value}
)
)
)
How to fix this and sort all records by Distance column from low to high
Your app is sorting the distance column of the collection as a string, e.g. "100.56 mi" rather than the number 100.56.
To get it working properly, consider adding a third column to your collection with the numeric value of the distance. Then, sort on that column.
Hope that helps,
Bryan
MS.Ragavendar
32
Rajkumar_M
16
Super User 2025 Season 1
mmbr1606
16
Super User 2025 Season 1