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

Fetch XML not retriving records with Filters in web page Liquid code

Hello ,


I am facing issue with fetch xml query . there is one custom entity that I want to retrieve using fetch XML . I have given specific Entity permissions for that entity to logged in user.

When I am adding fetch XML on web page, its retrieving all the records and not considering applied filters. I have copied fetch XML from advanced find and it is showing expected records there.

below is the query that I have used

{% fetchxml query %}
<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false">
<entity name="contact">
<attribute name="fullname" />
<attribute name="telephone1" />
<attribute name="contactid" />
<order attribute="fullname" descending="false" />
<filter type="and">
<condition attribute="fullname" operator="eq" value="test" />
{% endfetchxml %}
Size :: {{query.results.entities.size}}

{% for record in query.results.entities %}
FullName :: {{record.fullname}}
<br />
{% endfor %}


strangely when I placed <filters> tag before <attributes> tag it started working but issue still occurs as it doesn't work with multiple filter conditions and only first attribute will be available in results.  generally XML should not rely on sequence of tags and I never faced this kind of issue in previous versions. Anyone has faced this issue? Please help.






Super User II
Super User II

Hi @PoojaD


I just tested your code here and seems fine, nothing wrong with it:





I don't have a phone number associated to my contact.. but when removing the filter, it showed up all contacts' numbers, so it is working as expected

would you have maybe multiple entity permissions o the Contact entity that might be mixing things up by any chance?



If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.



If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Power Apps Portals Super User

Oliver Rodrigues


Helpful resources

Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.


Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Users online (10,517)