cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MSC01
Helper I
Helper I

Bingmaps. GetRoute using a button for gallery

Hi i am using a gallery that is filtered by a dropdown where users can select certain options. The gallery retrieves a list of users that match the option selected in the drop down. Each user has a label of their postcode, i have also used labels that contain bingmaps.getRoute that calculate distance and another for duration. The destination is entered via a input text box and each user has their own label for distance and duration from their own post code to their destination label (which is the same as it uses the address entered in the input box). i wanted to know how do i only get the gallery to use the api when a button is clicked and it uses the updated value entered in the input box. Need to keep in mind that when the app starts the input box can be blank.

1 ACCEPTED SOLUTION

Accepted Solutions
v-xiaochen-msft
Community Support
Community Support

Hi @MSC01 ,

 

Could you tell me:

Do you want the distance to be updated only after the user enters a value in the textinput control and presses the button?

 

If my assumptions are correct, please use a variable.

 

I did a test for you:

1\ Add a textinput control 'TextInput1' 

 

2\ Add a button control and set its OnSelect property to:

Set(Thevar,TextInput1.Text)

 

3\ Add a label and set its Text property to:

BingMaps.GetRoute("Seattle",Thevar).travelDistance

 

4\ The result is as follows:

AAA.gif

Best Regards,
Wearsky
If my post helps, then please consider Accept it as the solution to help others. Thanks.

View solution in original post

2 REPLIES 2
v-xiaochen-msft
Community Support
Community Support

Hi @MSC01 ,

 

Could you tell me:

Do you want the distance to be updated only after the user enters a value in the textinput control and presses the button?

 

If my assumptions are correct, please use a variable.

 

I did a test for you:

1\ Add a textinput control 'TextInput1' 

 

2\ Add a button control and set its OnSelect property to:

Set(Thevar,TextInput1.Text)

 

3\ Add a label and set its Text property to:

BingMaps.GetRoute("Seattle",Thevar).travelDistance

 

4\ The result is as follows:

AAA.gif

Best Regards,
Wearsky
If my post helps, then please consider Accept it as the solution to help others. Thanks.

View solution in original post

MSC01
Helper I
Helper I

Thanks for posting this solution, i managed to get there in the end. I had another question, the gallery is linked to CDS and the fields used are from this source e.g name and postcode. I have included the label for distance and duration into the gallery using the bingmaps.getRoute - is there any way to order by duration label if the gallery is filtered by a drop down where i am using name in 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,083)