I am working with a Microsoft Powerapps application with .NET. I am using Web Templates to create custom pages in the app. I want to pass values between two templates. Any idea how can I do that? Currently, I am using the parameter approach using ajax calls like the below. But, I want to pass more than one value (ex: 50 values). How can I do that?
Template1: Here I am making an ajax call to a service that is in another web template as follows:
var eid = eid;
$.ajax({
type: "GET",
url: "/getcodes/?eid="+eid,
data: "",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (res) {
var obj = res;
console.log(obj);
},
error: function (msg) {
//alert(msg);
}
});
Template2: Here I am getting the parameter request and the value in the request and assigning it to a liquid variable. I am processing the variable received using the FETCHXML query and getting the data.
{%- assign eid = request.params['eid'] -%}
{% fetchxml contact %}
<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false' no-lock='true'>
<entity name='entitlement' >
<attribute name='customerid' />
<attribute name='etid' />
<filter>
<condition attribute='etid' operator='eq' value='{{ eid }}' />
</filter>
</entity>
</fetch>
{% endfetchxml %}
So, My question here is: IS THERE ANY OTHER WAY TO PASS VALUES BETWEEN THE TEMPLATES OTHER THAN PARAMETERS?