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

Announcements

News and Announcements icon
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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Pages

#1
rezarizvii Profile Picture

rezarizvii 71

#2
DP_Prabh Profile Picture

DP_Prabh 36

#3
oliver.rodrigues Profile Picture

oliver.rodrigues 32 Most Valuable Professional

Last 30 days Overall leaderboard