cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

Portal - Liquid Template with FetchXML - OptionSet Label

I have set up a Liquid template with a FetchXML query, but I can't seem to get a link-entity optionset label to be displayed!  If the optionset resides on the parent entity I can see the associated label but not within a link-entity attribute.  Anyone experience this before?

 

{% fetchxml my_query %}
<fetch>
<entity name="pcx_caseplayer" >
<attribute name="statuscode" />
<link-entity name="pcx_caseplayer" from="pcx_representedby" to="pcx_caseplayerid" alias="AnotherPlayer">
<attribute name="statuscode" />
</link-entity>
</entity>
</fetch>
{% endfetchxml %}

<table>
{% for result in my_query.results.entities %}
<tr>
<td>
{{ result.statuscode.label | escape }} <br>**
{{ result['AnotherPlayer.statuscode.label'] | string }}
</td>
</tr>
{% endfor %}
</table>
RESULTS:

Annotation 2019-09-18 123317.png

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Helper I
Helper I

Re: Portal - Liquid Template with FetchXML - OptionSet Label

Actually, the correct syntax is:

 

{{ result['deadline.statuscode'].label }}
 
But thank you for the hint to get to my answer!

View solution in original post

2 REPLIES 2
Highlighted
Community Support
Community Support

Re: Portal - Liquid Template with FetchXML - OptionSet Label

Hi @mcutchins ,

Do you want to use FetchXML query to retrieve data from your CDS Entities?

 

Based on the formula you provided, I afraid that there may have something issue with it. Please consider modify your formula as below:

{% fetchxml my_query %}
<fetch>
  <entity name="pcx_caseplayer" >
   <attribute name="statuscode" />
   <link-entity name="pcx_caseplayer" from="pcx_representedby" to="pcx_caseplayerid" alias="AnotherPlayer"  link-type='inner'>
      <attribute name="statuscode" />
   </link-entity>
  </entity>
</fetch>
{% endfetchxml %}

<table>
{% for result in my_query.results.entities %}
<tr>
  <td>
    {{ result.statuscode.label | escape }} <br>**
    {{ result['AnotherPlayer'].statuscode.label | string }}
  </td>
</tr>
{% endfor %}
</table>

More details about using FetchXML to query data, please check the following article:

https://docs.microsoft.com/en-us/powerapps/developer/common-data-service/use-fetchxml-construct-quer...

 

Please check if you have typed a proper FetechXML syntax within your above formula.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Helper I
Helper I

Re: Portal - Liquid Template with FetchXML - OptionSet Label

Actually, the correct syntax is:

 

{{ result['deadline.statuscode'].label }}
 
But thank you for the hint to get to my answer!

View solution in original post

Helpful resources

Announcements
Check this Out

Announcing

Class of 2020- Season 2

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (8,973)