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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / Retrieve data with Liq...
Power Pages
Answered

Retrieve data with Liquid and FETCH XML

(1) ShareShare
ReportReport
Posted on by 48

Hello.

I have a problem with fetching data using fetchxml.
Some time ago it worked for me, now it works strangely.

Here is my code:

{% fetchxml params %}
  <fetch mapping="logical">
    <entity name="dyn365bc_params_test">
      <attribute name="dyn365bc_parameter_name"/>
      <attribute name="dyn365bc_parameter_value"/>
      <attribute name="dyn365bc_no"/>
      <attribute name="dyn365bc_params_test" />
  </entity>
  </fetch>
  {% endfetchxml %}
   {% for resultparams in params.results.entities %}
    {{ resultparams.dyn365bc_parameter_value }}
    {{ resultparams.dyn365bc_parameter_name }}
    {{ resultparams.dyn365bc_params_test }}
    {{ resultparams.dyn365bc_no }}
{% endfor %}


And as a result I get:

hubjes_0-1718884047760.png


And this is data in the table:

hubjes_1-1718884111689.png

So I retrieve the data from 'dyn365bc_parameter_name' and 'dyn365bc_params_test' (it's a GUID field).
I've done some tests and it always shows data from the first attribute I select to retrieve, no matter what kind of field it is and in addition it shows data from the GUID type field.
Do you have any idea why I can't show all attributes at the same time? I think the permissions in Power Pages and the field names are correct because I can retrieve data from any field, but only if it is my first attribute in the fetch xml.

 





Categories:
I have the same question (0)
  • EmadBeshai Profile Picture
    806 Moderator on at

    Hi @hubjes ,

     

    Did you check your table permissions for this table?

     

    If this post helps you with your problem, please mark this answer as Accepted Solution.

    If you like my response, please give it a Thumbs Up. 

  • Verified answer
    hubjes Profile Picture
    48 on at

    Hi.

    Permission was fine, I think the problem occurs when you try to use fetchxml multiple times for a specific table on the same website. When I use fetchxml only once per website, it works ok.

  • Christian Leverenz Profile Picture
    1,214 on at
    Hi @hubjes,
    i recenently was also using fetchXML agin after a long time and stumbled across a strange remark in the documentation ( https://learn.microsoft.com/en-us/power-pages/configure/liquid/template-tags#fetchxml ) : you shall not use selfenclosing tags. so, instead of <attribute name="harry"/> you should use <attribute name="harry"></attribute>
    sounds a little bit strange,, but may be its serious now. You will always get the id if the entry as this is a specific attribute in the response.
     
    Hope it helps.
    Have fun,
    Christian
     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Pages

#1
Fubar Profile Picture

Fubar 89 Super User 2025 Season 2

#2
Jerry-IN Profile Picture

Jerry-IN 75

#3
sannavajjala87 Profile Picture

sannavajjala87 31

Last 30 days Overall leaderboard