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 / Liquid fetchxml get op...
Power Pages
Answered

Liquid fetchxml get optionset/lookup value from linked entity

(0) ShareShare
ReportReport
Posted on by 60

I am joining two entities with a fetchxml query.

<fetch top="50" >
<entity name="entity1" >
<attribute name="field1" />
<filter>
</filter>
<link-entity name="entity2" from=".." to=".." alias="aa">
<attribute name="field2" />
<attribute name="field3" />
</link-entity>
</entity>
</fetch>

 

field 2 and field 3 are lookup and optionset respectively. I am trying to access the values using result['entity2.field2.name'] and result['aa.field3.label'], but i get blank for both.

 

Is there a way to get these values?

Categories:
I have the same question (0)
  • justinburch Profile Picture
    Microsoft Employee on at

    Assuming result is the iterative object from your for loop, try {{ result.aa.field3.label }} - otherwise it's expecting aa.field3.label to be a static string. Also, try filtering your fetch to only those that have data in field3 to ensure you're testing against data that should have a value.

     

  • Verified answer
    Fubar Profile Picture
    8,505 Super User 2026 Season 1 on at

    Is there a way to get the value, Yes.  I can't remember exactly off the top of my head using the array notation but I think you have too much in the [].

    Something more like result['aa.field3'].label

     

    also see

    https://powerusers.microsoft.com/t5/Building-Power-Apps/Portal-Liquid-Template-with-FetchXML-OptionSet-Label/m-p/364341

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I would ensure you can retrieve the ID first.

    {{ result['aa.field2'].id }}

    Once you have got the ID coming back, that proves your permissions are Okay.

    Then I suggest trying to get the text value back, but depending on the field type you have setup try the following:

    {{ result['aa.field2'] }} 
    {{ result['aa.field2'].value }}
    {{ result['aa.field2'].label }}
    {{ result['aa.field2'].text }}
    {{ result['aa.field2'].name }}
    
    {{ result['aa.field3'] }} 
    {{ result['aa.field3'].value }}
    {{ result['aa.field3'].label }}
    {{ result['aa.field3'].text }}
    {{ result['aa.field3'].name }}

    Let me know if this helps.

     

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Pages

#1
11manish Profile Picture

11manish 50

#2
Valantis Profile Picture

Valantis 26

#3
omkarsupreme Profile Picture

omkarsupreme 24

Last 30 days Overall leaderboard