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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / Web resource doesn't w...
Power Pages
Answered

Web resource doesn't work in webform step

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I have created a web form with 3 steps based on account entity's tabs.

 

In the first step I have summary tab, in the second step I have a custom bing map by which I will pick latitude and longitude from the map and will add in account entity's latitude and longitude. And in the 3rd step I have details tab.

 

In the second step I have a custom tab based on web resource which doesn't work in web form. 

 

Has any workaround how can I make second step workable?

 

If web resource doesn't work can I add page template? I have seen page can be added with redirect option but I don't need redirect. 

 

And also how can I set latitude and longitude for account entity using liquid syntax and save on the second step?

 

Any help please.

Categories:
I have the same question (0)
  • justinburch Profile Picture
    Microsoft Employee on at

    Hi @Anonymous,

    Why doesn't the web resource work? Is it an issue of the iframe itself? If so, you could attempt to to use the "Render Web Resources Inline" option to have the code placed directly into the HTML instead of an iframe.

    justinburch_0-1601573463383.png

    As for the question of the Page Template - your Page Template is what defines the layout of the Page, which hosts the Web Form - so no, you can't embed a Page Template into a Web Form Step. Instead, the Web Form Step is, in a way, embedded into a Page Template. You could add code to your Page Template, but you likely need a way to identify which step has just been loaded in order to show from the Page Template at the right time. It's probably easier to get the Web Resource working, as long as the Web Resource isn't trying to use the standard API or any other data inaccessible in the Portal.

    Additionally, Liquid cannot be used to make an update. Liquid is a pre-rendering template language only. If the data exists already, you can retrieve it using liquid and put it in input fields to grab with JS, but if it's data you're entering in Step 2 in order to save to the Account entity itself, you'll have to continue your current path.

    Example of storing the latitude/longitude if it exists on load of step 2:

    {% assign acct = entities.account[params.id] %}
    <input type="hidden" id="lat" value="{{ acct.address1_latitude }}">
    <input type="hidden" id="long" value="{{ acct.address1_longitude }}">
    <script>
     $(document).ready(function () {
     window.mapCoords = window.mapCoords || {};
     window.mapCoords.lat = $("#lat").val();
     window.mapCoords.long = $("#long").val();
     });
    </script>

    You would now have a global object to retrieve the hidden lat/long from.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi Justin,

    Thank you for your reply.

     

    Since template can't be embedded inside webform step so is it possible to detect steps inside template or page if I embed webform there.

     

    I have 4 steps. In my step 3 I want to add html code which will render the map. Now I want to detect step 3 so that I can integrate my map's html code under that step. For example:

    {% webform name: 'My Web Form' %}

    {{if step ==3 }}

    <map></map>

    {{endif}}

     

    It seems that I can detect step from query string through the url but I don't want to make hard condition with hard code step GUID id.  Is it possible with liquid code following best practice so that my code can work in any environment? 

     

     

  • Verified answer
    justinburch Profile Picture
    Microsoft Employee on at

    Hi @Anonymous,

    No, there isn't a liquid object for the webform steps that I'm aware of.

    You could consider setting a global variable in the Custom JavaScript section of the Web Form Step and reference that in the Web Template. E.g.

    // in Custom JavaScript of Step
    $(document).ready(function () {
     window.customCode.showButton();
    });
    
    // in Web Template
    <script src="text/javascript">
     $(document).ready(function () {
     window.customCode = window.customCode || {};
     window.customCode.showButton = function () {
     // create & show button
     };
     });
    </script>
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi Justin,

    Thanks a lot for your such valuable responses. 

     

    I am facing an issue like when I edit any page using Portal Studio Editor instead of Portal Management then if I have any div with id attribute like:

     

    <div id="map" class="map"></div>

     

    when I save the page the id attribute is being removed and my content saved as:

    <div class="map"></div>

     

    not sure why id="map" is getting removed. Do you have any idea?

     

    "id" need to have in div to load the map.

     

    and also how to get the web form step submit button event? I want to add record into my custom entity when submit button is clicked.

     

    Thanks.

     

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Pages

#1
Fubar Profile Picture

Fubar 33 Super User 2026 Season 1

#2
Mohsin Ali Profile Picture

Mohsin Ali 25

#3
SP2019admin Profile Picture

SP2019admin 20

Last 30 days Overall leaderboard