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 Pages / webtemplate as compone...
Power Pages
Unanswered

webtemplate as component and pass parameters to that webtemplate

(0) ShareShare
ReportReport
Posted on by

Is it possible to include custom coded webtemplate as component and pass parameters to that webtemplate and load in run time ?

 

I created one webtemplate which having HTML and javascript code for get data from dataverse I Wants to pass a parameter to that webtemplate and get results on runtime 

Categories:
I have the same question (0)
  • fm_skeller Profile Picture
    277 Moderator on at

    Yes, that is possible. you can include the webtemplate and pass parameters to the template as described here:
    Template tags | Microsoft Learn

    {% include 'My Template' a:x, b:y %}

    where x and y can be any liquid variable - in My Template they can be accessed through a and b

  • AB-15051012-0 Profile Picture
    on at

    I think you are looking fore something like this. Here is an example of my page, i am using the URL to get the variables. Then i use them during my fetch.

     

    {% assign type = request.params.type | split: "," %}
    {% assign start_date = request.params.start_date %}
    {% assign end_date = request.params.end_date %}
    {% assign status = request.params.status | split: ","  %}

    {% fetchxml werkorders %}
    <fetch>
      <entity name="msdyn_workorder">
        <attribute name="msdyn_name" />
        <attribute name="createdon" />
        <attribute name="msdyn_workordertype" />
        <attribute name="msdyn_substatus" />
        <attribute name="msdyn_totalamount" />
        <attribute name="msdyn_functionallocation" />
        <attribute name="msdyn_workorderid" />
        <link-entity name="msdyn_workordertype" from="msdyn_workordertypeid" to="msdyn_workordertype" link-type="inner" alias="workorder">
          <attribute name="msdyn_name" alias="WorkorderTypeName" />
        </link-entity>

        <filter type="and">
          {% if request.params.type > 0 %}
            <filter type="or">
              {% for item in type %}
                <condition attribute="msdyn_workordertype" operator="eq" value="{{ item }}" />
              {% endfor %}
            </filter>
          {% endif %}

          {% if request.params.status > 0 %}
          <filter type="or">
            {% for item in status %}
              <condition attribute="msdyn_substatus" operator="eq" value="{{ item }}" />
            {% endfor %}
          </filter>
        {% endif %}



          {% if request.params.start_date > 0 %}
            <condition attribute="createdon" operator="on-or-after" value="{{ request.params.start_date }}" />
          {% endif %}
       
          {% if request.params.end_date > 0 %}
            <condition attribute="createdon" operator="on-or-before" value="{{ request.params.end_date }}" />
          {% endif %}
         
       
       
        </filter>
      </entity>
    </fetch>
    {% endfetchxml %}
     
     
    I hope it helps. The above example might be a bit challenging but if you understand how to per example {% assign start_date = request.params.start_date %} then you can use that as a parameter in your fetch. Let me know if you need more help.
     
    Kind regards,
     
    Meton
  • AB-15051012-0 Profile Picture
    on at

    My reply might not be what you are looking for, i am using a URL to parse the varables. The reply of

     
    fm_skeller might be what you are looking for. I am leaving the reply here so you can judge for yourself.

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 Pages

#1
Jerry-IN Profile Picture

Jerry-IN 71

#2
Fubar Profile Picture

Fubar 62 Super User 2025 Season 2

#3
sannavajjala87 Profile Picture

sannavajjala87 31

Last 30 days Overall leaderboard