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

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
Frequent Visitor

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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (75,692)