I've got a list of 300+ locations that I would like to allow a user to search by entering their postcode and then the app displaying the results by nearest first.
I've got the first few steps sorted, and an output into a gallery which automatically goes to alphabetical order based on the location name. This shows up fine, along with the miles to each location from the entered postcode.
However when I try to organise it by mileage I get the error "one or more locations specified in the waypoint parameter are invalid or require more information"
I'm using
SortByColumns(SiteDistance,"Miles",SortOrder.Ascending)
for the gallery and a button with the OnSelect function below to populate the collection "SiteDistance"
ClearCollect(SiteList,Directory);
ClearCollect(SiteDistance, AddColumns(SiteList, "Miles", Value(Round(BingMaps.GetRouteV2(TextInput1.Text,postcode,{distanceUnit:"Mile"}).travelDistance,0))))
I'm fairly new to this so learning as I go, I'd appreciate some guidance on what's missing, and why it works when there's no sorting, but the error happens when I try and sort it by nearest first.
Many thanks