cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AndKanPA
Resolver I
Resolver I

2nd level link-entity

Hello community,


in a webtemplate a query like this:

 

 

{% fetchxml fetchquery %}
<fetch mapping="logical" version="1.0" distinct="true" output-format="xml-platform">
  <entity name="entity01">
    <all-attributes />
    <filter type="and">
      <condition attribute="createdon" operator="today" />
    </filter>
    // 1st level
    <link-entity name="entity02">
      <all-attributes />
      // 2nd level
      <link-entity name="entityA" alias="fa">
        <attribute name="name" />
      </link-entity>
    </link-entity>
  </entity>
</fetch>
{% endfetchxml %}

 

It works fine and XRMtools FetchXMLTester outputs all data.

How to output attribute from link-entity EntityA in webtemplate?

 

{% for record in fetchquery.result.entities %}
  entity01: {{ record.attribut1 }}
  entity02: {{ record['entity02.attribut21']}}
  entityA: {{ record[ ??? ] }}
{% endfor %}

 

Looks nice, but didnt work:

 

{{ record['entity02[entityA.name]'] }}

 

Same with:

 

{{ record['entity02["entityA.name"]'] }}

 


It ends with:
Liquid error: Value cannot be null. Parameter name: key


Any help?


One solution could be, to use an additional query to entityA to request the value.
A solution but not nice.

 

Thanks,
AndKan.

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @AndKanPA ,

I had this problem before when tried to get the data and the answer was surprisingly simple. Just use an alias of the second level entity and get it if it was the first level:

{{ record['fa.name'] }}
----------------------------------------------------
If you find this post helpful consider marking it as a solution to help others find it.

View solution in original post

2 REPLIES 2

Hi @AndKanPA ,

I had this problem before when tried to get the data and the answer was surprisingly simple. Just use an alias of the second level entity and get it if it was the first level:

{{ record['fa.name'] }}
----------------------------------------------------
If you find this post helpful consider marking it as a solution to help others find it.
AndKanPA
Resolver I
Resolver I

Hi @OOlashyn ,

an alias as solution. Sounds really simple ...

 

Thank you.

Helpful resources

Announcements
Carousel Community Blog

Check out the Community Blog

Read all about the most recent blogs in the community!

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Carousel News & Announcements

What's New in the Community?

Check out the latest News & Events in the community!

Users online (3,928)