Skip to main content

Notifications

Power Pages - Security
Answered

fetchxml permissions

(0) ShareShare
ReportReport
Posted on by 138
All,
 
Having difficulty getting liquid to render on a page.  After much work/research/attempts. it must be a permissions issue.
 
I've set the table permissions for both anonymous = Read and Auth/Admin = Full
 
 
 
Here is a test example.  This code is in a web template called "accountFetch-web-template";
 
***************************
{% fetchxml accounts %}
<fetch top="5">
  <entity name="account">
    <attribute name="name" />
    <attribute name="accountid" />
  </entity>
</fetch>
{% endfetchxml %}
 
<p>Number of records returned: {{ accounts.results.size }}</p>
***************************
 
It is called from a web page with {% include 'accountFetch-web-template' %}
 
But nothing is displayed.
 
Any ideas on how to get liquid to show would be greatly appreciated.
 
Doug
 

 
 
 
Categories:
  • Verified answer
    dgray304 Profile Picture
    dgray304 138 on at
    fetchxml permissions
    Oliver,
     
    The latter.  The label rendered, but no value from liquid.
     
    This line was the problem:  <p>Number of records returned: {{ accounts.results.size }}</p>  The liquid was bad and it broke the rest.
     
    I pasted your TABLE iterate code in and found it worked.  ONLY after removing the trouble line (above).

    I was using "accounts.results.size".  I needed to use "accounts.results.entities".
     
    Taking the offending code out, allowed the loop to render.
     
    NOTE: Only way to get the count was to initialize a var to zero, then increment during the loop.

    Thanks, your response helped me get to a resolution.
     
    Doug 
  • Verified answer
    oliver.rodrigues Profile Picture
    oliver.rodrigues 8,962 on at
    fetchxml permissions
    Hi
     
    when you say nothing is rendered, is the page fully blank or do you see something like:
    "Number of records returned: " (with no count showing)
     
    did you try to render the results of or fetch?, for example
    <table>
    {% for entityVariable in accounts.results.entities %}
    <tr>
    <td>Attribut-1: {{ entityVariable.name }}</td>
    <td>Attribut-2: {{ entityVariable.accountid }}</td>
    </tr>
    {% endfor %}
    </table>
     

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

November 2024 Newsletter…

November 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #9 Get Recognized…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 144,215

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 64,290

Leaderboard

Featured topics