When I play my PowerApp outside of the studio, I get this error when the app opens. However, the error does not show within the studio. Playing the app outside of the studio, I can still use the app, but the error notification is annoying. A screen on my app is using Bing to calculate the distance between two cities:
Value(Round(BingMaps.GetRoute(StudentGallery_1.Selected.City & ", " & StudentGallery_1.Selected.State, ThisItem.HOME_CITY & ", " & ThisItem.STATE).travelDistance/1.609344,0))
Any idea why the error is showing?
Do you firstly add one BingMap Api connection?
Could you please try to change your formula expression as this:
Value(Round(BingMaps.GetRoute(StudentGallery_1.Selected.City & ", " & StudentGallery_1.Selected.State, StudentGallery_1.HOME_CITY & ", " & SStudentGallery_1.Selected.State).travelDistance/1.609344,0))
And I test as the next screenshot shows,it works ok:
My formula expression:
Value(Round((BingMaps.GetRoute(Gallery2.Selected.City& "," &Gallery2.Selected.State, Gallery2.Selected.HomeCity &","& Gallery2.Selected.State).travelDistance/1.609344),0)) (Galllery2 is my gallery control name on my side)
Hope this could be helpful.
@v-yuxima-msft Thank you, but my formula is calculating a city and state from my student gallery(StudentGallery_1) against all items within another gallery (Employee gallery); that is why I'm using ThisItem so that the Miles field can display the distance between all items in the gallery against the city/state at the top/left of my graphic.
@v-yuxima-msft The employee gallery is empty when the app opens and its only populated when a user selects a student from the student gallery. The error goes away once the employee gallery is populated and the calculations are correct. I wonder if there's a way to only execute the calculation upon the selection in the student gallery. Not sure.
Could you please share more details of your two gallerys?
And what the Button control's formula expression?
I think more details will help to analyze the issue here.
The screenshot with the calendar is my Student Gallery, which contains a Hometown field and a State field. The admin user will click the Select Student button to select that student and populate the student's name, hometown, and state. Next, the user will click the Select Employee arrow to navigate to the Employee gallery.
The second screenshot, the Employee Gallery, has a filter where:
Filter(Employee DATA SOURCE,StudentGallery_1.Selected.State = EmployeeState) - Meaning, only display employees in the employee gallery where their State matches the state of the student.
The Miles label in the Employee Gallery has this formula (the formula is in the label in the gallery's template):
Value(Round(BingMaps.GetRoute(StudentGallery_1.Selected.City & ", " & StudentGallery_1.Selected.State, ThisItem.EmployeeHometown & ", " & ThisItem.EmployeeState).travelDistance/1.609344,0)) - This means that the miles label will display the distance between the selected student's city/state and every employee's city/state in the entire gallery. The user will review the gallery and select the employee with the closest promixity to the student.
The app works perfectly, but the error message displays when you play the app in studio and in a browser.
Continue your learning in our online communities.
Features releasing from October 2019 through March 2020
Coming to a city near you
Fill out a quick form to claim your user group badge now!
Connect, share, and learn with your peers year-round
Register by September 5 to save $200