web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Calling Bing Maps REST...
Power Apps
Answered

Calling Bing Maps REST jsonp inside model-driven app forms

(0) ShareShare
ReportReport
Posted on by 230

I noted that bing maps provide only JSONP service to retrieve geolocation data (precisely Reverse Geocode locations).

So, if I need to retrieve only address info (without the map) from Bing via JavaScript and put them into a form, I have only 3 way:

  • standard JS but with the logic constraint to attach the HTMLscript' tag
  • using jQuery
  • using AngularJS

So, using standard JavaScript with 'script' JSONP request tag isn't possible: violates the form structure integrity accessing the DOM!

Using jQuery, I hope it is compatible, but Microsoft Dataverse guidelines discourage using $.ajax

I think the third option (Angular) is the best practice but I don't have skills in this big JS library. Extend my VS projects with Angular complicates the management.

Finally, I don't want to achieve an address by Power Automate or Plugin because before, I have to detect the latitude and the longitude remaining on the same form. So working on the mobile form, calling the service by push-button on the Ribbon, all js client-side logic. 

I don't want to perform reverse Geocode location by Power Apps Embedded Canvas App because Embedded Canvas Apps aren't still available for mobile in Model-driven apps layout.

XMLHttpRequest() is not compatibile for JSONP and it involves CORS logic.

 

So, Has anyone found another optimal solution with Web API or REST calls?  

Returning to jQuery with MS Dataverse is very sad!

 

Link:

https://docs.microsoft.com/en-us/bingmaps/v8-web-control/map-control-concepts/rest-services-examples/

https://docs.microsoft.com/en-us/bingmaps/rest-services/locations/find-a-location-by-point

 

I have the same question (0)
  • Fubar Profile Picture
    8,361 Super User 2025 Season 2 on at

    Insert a html Web Resource on the model driven app Form - inside the Web Resource itself you are allowed put your own HTML and JS and to dynamically modify it.  From the Web Resource you can read and write to the main form attributes.

     

    (If you need to hide an apikey or credentials, custom C# code registered against a custom Action and then call the Action via JS)

     

    Just make sure that you comply with any licencing with regards to storing the geocodes etc.

  • David Pezzoli Profile Picture
    230 on at

    Ok, but in the future Web Resources will be deprecated and replaced with PCF...

    Is PCF a good alternative? But with PCF I need to add a Web project VS with TypeScript and set this logic on a text field control...

  • Fubar Profile Picture
    8,361 Super User 2025 Season 2 on at

    @David_Pezzoliwhere has Microsoft announced they are deprecating Web Resources? (they even have them as solutions for working around other deprecations they have announced) There is so much existing code in Web Resources even if they do deprecate them it will be an extremely long time before they actually remove support.

  • Verified answer
    David Pezzoli Profile Picture
    230 on at

    You're right! But Microsoft Dynamics 365 Code Review force vendors to replace HTML Web Resources with new PCFs. I worried deprecation on old Web Resources reference: parent.Xrm.Page.

     

    Any case, thank you for your suggestions. I figure out using Custom Action instead jQuery. 

    So it is Custom Action the 4th solution:

    • secure Key Maps
    • call input lat-long client-side and get output address from server-side
    • get all inside form by push button without using jQuery or HTML Web Resource.

    Thanks!

  • Fubar Profile Picture
    8,361 Super User 2025 Season 2 on at

    @David_Pezzoliwhilst MSFT are going to get rid of parent.Xrm.Page at some stage (no date yet), this does not mean that Web Resources will cease to be useful etc MSFT are recommending if you need to use parent,Xrm that you either go PCF OR use .getContentWindow (with the latter you can still pass in the formContext and Xrm context into your Web Resource so in most scenarios you do not need parent.Xrm). 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard