cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
mcutchins
Level: Powered On

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
mcutchins
Level: Powered On

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
Community Support Team
Community Support Team

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.
mcutchins
Level: Powered On

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
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors
Users online (4,614)