cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Regular Visitor

Filter Gallery based off of Bing Maps distance calculation which is housed in the Gallery for each row

I am still fairly new to Power Apps and need some guidance.

 

I am creating a canvas application that takes a user's address inputs and creates a collection. This collection allows me to utilize the Bing Maps "Get Route" function and calculate the distance between the collection address and the gallery's vendor locations (data set is 20k+ rows so I have to avoid delegation). The vendor gallery should be filtered by the product gallery first and then by the distance <= radius. I also need the gallery to be sorted by the distance (smallest to largest). I am utilizing a dropdown for the radius values outside of the vendor gallery and the distance is calculated and shown within the gallery for each vendor with no ties to a table. The vendor data is connected to a Dataverse table. the current formula for the vendor gallery items is as follows:

 

Gallery Items Formula

SortByColumns(
Search(
'STEERAGE Data', Local_ProductGallery.Selected.'PRODUCT NUMBER',
"productnumber"
),"vendortier",Ascending,"avgtotalcost")
 
Calculated field (Distance)
If(IsEmpty(PatientAddress), 0 ,
RoundUp(BingMaps.GetRoute(First(PatientAddress).point.coordinates.combined,BingMaps.GetLocationByAddress({addressLine:ThisItem.ADDRESS_LINE1,locality:ThisItem.CITY,adminDistrict:ThisItem.STATE,postalCode:ThisItem.ZIP}).point.coordinates.combined,{distanceUnit:"Mile",travelMode:"Driving"}).travelDistance,0))
0 REPLIES 0

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (63,380)