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 / Issue when performing ...
Power Pages
Unanswered

Issue when performing a fetch + liquid inside Portals

(0) ShareShare
ReportReport
Posted on by 4

Inside a Portal i’m using scripts to complete a fetch on the dataverse tables. For some reason, those scripts stopped working properly. They were working ok until some days ago. Scripts like this inside different portals stopped working properly as soon as the portals pages with these scripts are sync.

 

As a test, i created a table with data on dataverse:

 

bda_0-1659430430109.png

 

Then, the script, inside the portal page is supposed to read from this table 4 attributes (I add a filter just to read the third row). When I run the script, I got this:

 

bda_1-1659430430112.png

 

In this case, it returns just one attribute. It’s very strange.

 

The simple script:

 

  {% fetchxml readTable %}

            <fetch top="50">

              <entity name="bda_testtable">

                <attribute name="bda_name">

                  <attribute name="bda_position">

                    <attribute name="bda_testtableid">

                      <attribute name="bda_numberofcolours">

                      </attribute>

                    </attribute>

                  </attribute>

                </attribute>

                <filter>

                  <condition attribute="bda_testtableid" operator="eq" value="fe5f80ea-de10-ed11-a81b-00224842241f" uiname="aaa" uitype="bda_testtable">

                  </condition>

                </filter>

              </entity>

            </fetch>

            {% endfetchxml %}

 

            <!-- Parse through results -->

            {% for readTable in readTable.results.entities %}

            <table border="1">

              <tbody>

                <tr>

                  <td>Numbers</td>

                </tr>

                <tr>

                  <td>{{readTable.bda_numberofcolours}}</td>

                  <td>{{readTable.bda_name}}</td>

                  <td>{{readTable.bda_position}}

                  </td>

                </tr>

              </tbody>

            </table>

            {% endfor %}

 

Any help will be very welcome.

 

Thank you

Categories:
I have the same question (0)
  • Christian Leverenz Profile Picture
    1,214 on at

    Hi @bda ,

    not sure, whether this is the problem, but the fetch is somewhat diffrent from thjose i use. You have something like

    <attribute name="bda_name">

                      <attribute name="bda_position">

                        <attribute name="bda_testtableid">

                          <attribute name="bda_numberofcolours">

                          </attribute>

                        </attribute>

                      </attribute>

                    </attribute>

    But it should be:

    <attribute name="bda_name"/>

    <attribute name="bda_position"/>

    <attribute name="bda_testtableid"/>

    <attribute name="bda_numberofcolours"/>

     

    May be, there was an update in the backend so that your expression is not recognized anymore.

     

    Hope be it helps,

      Christian

  • Hugo Bernier Profile Picture
    on at

    @bda this seems to happen when you auto-format the source (e.g. when using VS Code or copying and pasting) where it seems to move each attribute node as a child of the previous one, when they should all be at the same level (below the entity node).

     

    The response from @chleverenz is a great example of how the query should look like.

     

    I hope this helps?

  • ragavanrajan Profile Picture
    7,044 Most Valuable Professional on at

    Hi @bda 

     

    The simple way to fix your problem is as follows 

    1. Use the advanced find in Portal Management and filter the records then download the fetch XML 

    2. I highly recommend you to use XRMToolbox 

    https://fetchxmlbuilder.com/   

    Using FetchXML builder > you can get perfect XML Queries. Feel free to tweak XML queries according to your need. 

    Note: In all the cases, Table permissions are significant and related webroles. 

     

    Hope it helps. 
    ------------

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

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 78 Super User 2025 Season 2

#2
Jerry-IN Profile Picture

Jerry-IN 75

#3
sannavajjala87 Profile Picture

sannavajjala87 31

Last 30 days Overall leaderboard