I have a Sharepoint list of shops with their UK postcodes as a single line of text. I would like to be able to enter my postcode and find the nearest shop. I would like to do this using a canvas app.
I was connecting to Bing. This works now. Thank you.
Is this right?
Hi @AlHal2,
I see in your screenshot the 'Microsoft Stores' list name and 'Visit Address: Postal Code' field of my dev tenant SharePoint list example are still there. I am assuming I am not that lucky that in your setup it is exactly the same 😁
Can you please update that part of the formula to reflect your SharePoint list setup?
Does this help? In App On Start I have the following which I can change.
ClearCollect( Shops,
{ Postcode: "NW17FB",Distance:0},
{ Postcode: "SW1A1AA",Distance:0}
)
Hi @AlHal2,
Can you share some screenshots of your setup (both the canvas app and the SharePoint list) and the formulas with the errors you are getting?
This way we can troubleshoot a bit easier why you are getting invalid arguments errors.
Powerapps is saying that GetRouteV2 has some invalid arguments and AddColumns has some invalid arguments.
Hi @AlHal2,
You could use the Bing Maps connector and use the GetRoute method to retrieve the traveldistance for all your shops. Based on that you can sort on the smallest travel distance.
Below is an example with Microsoft Stores list from SharePoint:
In this example I am entering a postal code in a text input (in this example the Tower Bridge postal code).
1. In the OnSelect create a new collection DistanceToStores with a new column called distance. The text input is used as waypoint 1, the postal code field from the list item is used as waypoint two.
ClearCollect(DistanceToStores, AddColumns('Microsoft Stores', "Distance", BingMaps.GetRouteV2(TextInput_YourPostcode.Text, 'Visit Address: Postal Code').travelDistance))
2. The gallery is sorted by the new distance column, ascending. The closest shop will be the first in the gallery.
SortByColumns(DistanceToStores, Distance, Ascending)
Hope this helps to get you started?
MS.Ragavendar
32
Michael E. Gernaey
24
Super User 2025 Season 1
WarrenBelz
18
Most Valuable Professional