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 / Display linked entity ...
Power Pages
Unanswered

Display linked entity from FetchXML in JSON

(0) ShareShare
ReportReport
Posted on by 2,429 Super User 2025 Season 2

Hello everyone,

 

I am using the FetchXML Builder and the query shows exactly what I want.

 

 

{% fetchxml testXML %}
<fetch>
 <entity name="test_table">
 <attribute name="attr1" />
 <attribute name="LookUpField" />
 <attribute name="attr3" />
 <attribute name="attr4" />
 <link-entity name="linked_Table" from="xyz_id" to="name" alias="nameXYZ" visible="true">
 <attribute name="nameXYZ" />
 </link-entity>
 </entity>
</fetch>
{% endfetchxml %}

 

 

 

I want to retrieve a LookupField. But whysoever there's nothing displaying inside the LookUpField when I display it in a JSON.

I tried different combinations as below:

 

[
{% for item in testXML.results.entities %}
 {
 "Test1" : "{{ item.LookUpField }}",
 "Test2" : "{{ item.nameXYZ }}",
 "Test3" : "{{ item.LookUpField.nameXYZ }}"
 }{% unless forloop.last %}, {% endunless %}
{% endfor %}
]

 

 

 

Inside the FetchXML Builder it's working fine, but the fetchXML inside my pagetemplate seems to have an issue.

Do I need to give the FetchXML additional access or something as it is not even displaying the GUID neither the Name which is referenced inse the LookUp.

 

Has somebody come across something like that or know how I can display the linked name attribute of the lookup column?

Categories:
I have the same question (0)
  • ragavanrajan Profile Picture
    7,044 Most Valuable Professional on at

    Hi @Lucas001 

    For the lookup column table, hope you have set enough table permissions and assigned web roles properly.  Please check all your table permissions 

    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.

     

  • Lucas001 Profile Picture
    2,429 Super User 2025 Season 2 on at

    Hi @ragavanrajan,

     

    what I don't get. I can display the needed data in a view in a form or anything else. As I created the FetchXML witht he builder and it is working fine inside its UI as well. Copying that code and just trying to display it inside a JSON doesn't work.

     

    Is there anything else one has to give permission when using FetchXML with a LookUp Column?

     

  • Verified answer
    Lucas001 Profile Picture
    2,429 Super User 2025 Season 2 on at

    I finally found a solution.

     

    https://www.newdynamicllc.com/portal-pages-how-to-display-an-entity-list-using-fetchxml-and-liquid-code-for-a-more-custom-portal-page/

     

    [
    {% for item in testXML.results.entities %}
     {
     "Test1" : "{{ item.['yourAliasFieldName.yourNameofTheFieldInsideTheRelatedTable']}}"
     }{% unless forloop.last %}, {% endunless %}
    {% endfor %}
    ]

     

    It is difficult to find something like that when there's nowhere a documentation.

    @ragavanrajanmaybe you could submit that to the product team and ask them to include it into the documentation.

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

    sure @Lucas001 

     

    Thanks for the answer. I will pass the info and you can see some updates in the docs soon. 

     

    Thanks again. 

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
Jerry-IN Profile Picture

Jerry-IN 71

#2
Fubar Profile Picture

Fubar 62 Super User 2025 Season 2

#3
sannavajjala87 Profile Picture

sannavajjala87 31

Last 30 days Overall leaderboard