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

Handling errors when using bingmaps getROute

Hi, i am using bingmaps.get route in a label, one of the waypoints is based off a input field that the user inputs a address (not using the address input field that powerapp provides but a normal input field). is there any way to handle the 404 or 400 errors that could occur. For example if the user enters an incorrect postcode which will result in bingmaps returning a 400 error. However im not sure how to display the error message that is returned in powerapps.

1 ACCEPTED SOLUTION

Accepted Solutions
v-xiaochen-msft
Community Support
Community Support

Hi @MSC01 ,

 

I did a test for you:

1\ Open the setting as shown

v-xiaochen-msft_0-1616141465556.png

 

2\ Add a textinput control 'TextInput1' and set its onchange property to:

Set(thevar,TextInput1.Text)

 

3\ Add a button control and set its onselect property to:

IfError(BingMaps.GetRoute("Seattle",thevar).travelDistance, Set(A,"error"),Set(A,""));Set(thevar2,BingMaps.GetRoute("Seattle",thevar).travelDistance)

 

4\ Add a label control and set its Text property to:

thevar2

 

5\ Add a label control and set its Text property to:

A

 

6\ 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

1 REPLY 1
v-xiaochen-msft
Community Support
Community Support

Hi @MSC01 ,

 

I did a test for you:

1\ Open the setting as shown

v-xiaochen-msft_0-1616141465556.png

 

2\ Add a textinput control 'TextInput1' and set its onchange property to:

Set(thevar,TextInput1.Text)

 

3\ Add a button control and set its onselect property to:

IfError(BingMaps.GetRoute("Seattle",thevar).travelDistance, Set(A,"error"),Set(A,""));Set(thevar2,BingMaps.GetRoute("Seattle",thevar).travelDistance)

 

4\ Add a label control and set its Text property to:

thevar2

 

5\ Add a label control and set its Text property to:

A

 

6\ 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

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!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (2,747)