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

Liquid didnt output values

Hello community,

 

I have 3 tables.
Table 1 computers:
- Name (string)
- companyid (lookup 1:M table2)

- employeeid (lookup 1:M table3)

 

Table 2 companies: 

- Name (string)

 

Table 3 employees:

- Name (string)

 

FetchXML is:

 

<fetch top="50" distinct="true" >
  <entity name="cr847_table1" >
    <attribute name="cr847_company" />
    <attribute name="cr847_employe" />
    <filter>
      <condition attribute="cr847_tableid" operator="eq" value="640b201a-f939-eb11-a813-0022480691de" />
    </filter>
  </entity>
</fetch>

 

 

Result in FetchXML Builder are columns with GUID values like expected:

Idcr847_companycr847_employe
640b201a-f939-eb11-a813-0022480691de2c82dfe8-1fff-ea11-a815-000d3a98de0fa690e432-8efd-ea11-a815-000d3a1021f8

 

Same FetchXML in FetchXML-Tester returns response:

 

<resultset morerecords="0">
  <result>
    <cr847_company name="Highfive" type="10902">{914557BB-0EFF-EA11-A815-000D3A98DE0F}</cr847_company>
    <cr847_employe name="hero1" type="10903">{6BB332ED-1FFF-EA11-A815-000D3A1021F8}</cr847_employe>
  </result>
</resultset>

 

 

Fine so far.
When I try to output this result in a webtemplate with Liquid:

 

 

{% fetchxml table1_query %}
  # fetchxml from above
{% endfetch %}

{% for result in table1_query.results.entities %}
  {{ result.cr847_company }}
  {{ result.cr847_employe}}
{% endfor %}

 

 

nothing comes out.

Where is my mistake?


I think, everytime when FetchXML-Tester shows an additonal attribute like name or type in this example, I cannot use result.<attributname> for output.

 

Thanks for help,

AndKan.

 

1 ACCEPTED SOLUTION

Accepted Solutions
AndKanPA
Resolver I
Resolver I

{{ result.cr847_company['name'] }} and {{ result.cr847_company.name }} output "Highfive"
With {{ result.cr847_company['type'] }} I expected 10902, but outputs nothing.

I figured out, that{{ result.cr847_company['id'] }} returns 914557BB-0EFF-EA11-A815-000D3A98DE0F for my next fetch; {{ result.cr847_company.id }} too.

 

So my problem is solved.
But is somewhere a complete documentation about FetchXML and Liquid in PowerApp Portals? I think FetchXML with Liquid is very powerfull, but seems not documented?

 

View solution in original post

6 REPLIES 6
satyarkar
Frequent Visitor

Hi @AndKanPA , 

If your web page is enabled for entity permission, make sure the entity permission for the 'cr847_table1' is created. Follow the link below to add record based permission for the Portal. 

https://docs.microsoft.com/en-us/powerapps/maker/portals/configure/assign-entity-permissions 

Thanks,

Satya

Hello @satyarkar,

thank you, but it is sure not a problem of permissions.
I receive results of other attributes. And all results are in XRMtools available.

Hi @AndKanPA,

The record based security is different for Portal and XrmTools. If Portal web page is enabled for entity permission, you have to create Portal entity permission for all the tables (computers, companies and employees)  referenced in your fetchXml for Liquid to get result from Dataverse.  Next you have to associate the entity permission to the User's Web Role.  If still you have issue, it would be good to see your compete liquid script and entity permissions configuration. 

Thanks,

Satya

 

Hello @satyarkar

{{ table1-query.results.size }} returns 1 as expected.
With missing permissions it would return -1 (no records/ no result)

 

Thanks,

AndKan.

AndKanPA
Resolver I
Resolver I

{{ result.cr847_company['name'] }} and {{ result.cr847_company.name }} output "Highfive"
With {{ result.cr847_company['type'] }} I expected 10902, but outputs nothing.

I figured out, that{{ result.cr847_company['id'] }} returns 914557BB-0EFF-EA11-A815-000D3A98DE0F for my next fetch; {{ result.cr847_company.id }} too.

 

So my problem is solved.
But is somewhere a complete documentation about FetchXML and Liquid in PowerApp Portals? I think FetchXML with Liquid is very powerfull, but seems not documented?

 

satyarkar
Frequent Visitor

Hi @AndKanPA,

You can get the related table details in the same query. To get access to the entire entity, use the relationship name instead of the name of the lookup field, like so:

{% for result in table1_query.results.entities %}
   {{ result.<relationshipname>.fieldname }}
{% endfor %}
 
----------------------------------------------------
If you find this post helpful consider marking it as a solution to help others find it.

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 (4,422)