web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Liquid FetchXML returns empty object

(0) ShareShare
ReportReport
Posted on by

Hi all,

I had working an API called from Portals (managed on Portals > Web templates). It has been working until a couple of minutes ago when I changed some field on an entity's form.

Now, whenever I try to return any data from any entity it returns nothing. I am trying this with "Role" entity (just as an example):

% fetchxml feed %}
<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false" returntotalrecordcount="true">
  <entity name="role">
    <attribute name="createdon" />
    <order attribute="createdon" descending="true" />
  </entity>
</fetch>
{% endfetchxml %}{
  "totalcount": {{ feed.results.total_record_count }}
}


I also tried with {{ feed }} just for testing and nothing. Any suggestions?

*This post is locked for comments

I have the same question (0)
  • - Matt Bayes - Profile Picture
    890 on at

    Hi Martin,

    Make sure you have the correct Entity Permissions setup for the entities you are trying to retrieve through the fetchxml. I have found that no records will be retrieved if you do not.

    Also, I am unsure if it just got copied incorrectly but you are missing the open brace for your fetchxml tag.

    Matt Bayes

  • Suggested answer
    RaviKashyap Profile Picture
    55,410 Moderator on at

    Hi,

    Please double check your implementaion as per this blog - dyn365apps.com/.../dynamics-365-portals-liquid-templates-part-3-retrieve-data-using-fetchxml

  • Suggested answer
    Aric Levin - MVP Profile Picture
    30,190 Moderator on at

    The code looks good, so I would check the Entity Permissions to see that you have read access to the Role entity.

    I would also make sure that you have the proper curly brackets {}.

    Looks like it's missing from the beginning, and I am not sure that you need it after the endfetchxml:

    {% fetchxml feed %}
    <fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false" returntotalrecordcount="true">
      <entity name="role">
        <attribute name="createdon" />
        <order attribute="createdon" descending="true" />
      </entity>
    </fetch>
    {% endfetchxml %}
    "totalcount": {{ feed.results.total_record_count }}

    Hope this helps.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans