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.
Solved! Go to Solution.
Hi @Anonymous ,
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:
Best Regards,
Wearsky
If my post helps, then please consider Accept it as the solution to help others. Thanks.
Hi @Anonymous ,
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:
Best Regards,
Wearsky
If my post helps, then please consider Accept it as the solution to help others. Thanks.
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
User | Count |
---|---|
253 | |
101 | |
94 | |
47 | |
38 |