Hi @Anonymous ,
Based on the FetchXML query that you mentioned, I think there is something wrong with it.
Firstly, I agree with @OliverRodrigues 's thought almost. The following formula:
{% assign fullname = request.params.['fullname'] %}
{% assign cachestring = request.params.['cachestring'] %}
should be changed into following:
{% assign fullname = request.params['fullname'] %}
{% assign cachestring = request.params['cachestring'] %}
or
{% assign fullname = request.params.fullname %}
{% assign cachestring = request.params.cachestring %}
In addition, there is something issue with the <order> attribute. The attribute of the <order> should be bind to the logic name of the column defined in your above <attribute> tag. So the following formula:
<order attribute='First Name' descending='true' />
should be changed into below:
<order attribute='firstname' descending='true' />
You whole FetchXML Query should be like below:
{% assign fullname = request.params['fullname'] %}
{% assign cachestring = request.params['cachestring'] %}
{% fetchxml feed %}
<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'>
<entity name='contact'>
<attribute name='fullname' />
<attribute name='emailaddress1' />
<attribute name='contactid' />
<attribute name='firstname' />
<order attribute='firstname' descending='true' />
<filter type='and'>
<condition attribute='fullname' operator='eq' value='{{fullname}}' />
<condition attribute='fullname' operator='ne' value='{{cachestring}}' />
</filter>
</entity>
</fetch>
{% endfetchxml %}
[
{% for item in feed.results.entities %}
{
"Contact_id": "{{ item.contactid }}",
"Contact_Name": "{{ item.fullname }}",
"Contact_Email": "{{ item.emailaddress1 }}",
"Contact_First_Name": "{{ item.firstname }}"
}{% unless forloop.last %},{% endunless %}
{% endfor %}
]
For the way how parameters are passing, when you access a web page (in your Portal) which is based on your above FetchXML query through the following URL along with corresponding parameters, for example:
https://xxxxxx.powerappsportals.com/services/AccountList/?fullname=Steven&cachestring=Liu
then these appended parameters within the URL would be received by the request.params Liquid expression.
Please check the following article for more details:
https://docs.microsoft.com/en-us/powerapps/maker/portals/liquid/liquid-objects#request
Best regards,