Showing results for 
Search instead for 
Did you mean: 
Regular Visitor

Debugging liquid fetchxml permission issues

I would like to use a liquid fetchxml expression to obtain entity information. Next to some answers in this forum these two articles  Dynamics 365 portals liquid templates part 3  and How to use fetchxml did provide very useful information. As a result I created the following liquid template 


{% if user %}
Hallo, {{ user.firstname }} !
{% else %}
{% endif %}

{% fetchxml my_query %}
<fetch version="1.0" mapping="logical">
  <entity name="contact">
    <attribute name="fullname" />
{% endfetchxml %}

{{ my_query.xml | xml_escape}}

Count: {{ my_query.results.total_record_count }}
{% for result in my_query.results.entities %}
Name: {{ result.fullname}}
{% endfor %}



Setting global entity permissions for contact, binding that entity permission to the webrole 'administrator' and logging in onto the portal as administrator I still get as count '0', while pasting the resulting fetchxml into a tool like XRM toolbox does return (of course) contacts. This leads me to the conclusion that there is still something wrong with authorization - but I cannot figure out what. I tried for example extensions to the fetchxml tag (enable_entity_permissions: true, right: 'read'), but no luck. Is there any way to get more insight into reasons for authorization failures? It likely is something trivial that I overlook. Any help appreciated!


What is the value displayed for the XML attribute?  That is the combination of the original FetchXML, and any extra FetchXML included for Entity Permissions.

Helpful resources

New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users


We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Users online (19,767)