Skip to content

Commit 732e33e

Browse files
authored
Merge pull request MicrosoftDocs#2305 from MicrosoftDocs/portals-liquid-fetchxml
Portals liquid fetchxml tag
2 parents 37c2317 + 4ebd26e commit 732e33e

File tree

1 file changed

+67
-1
lines changed

1 file changed

+67
-1
lines changed

powerapps-docs/maker/portals/liquid/template-tags.md

Lines changed: 67 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ manager: kvivek
66
ms.service: powerapps
77
ms.topic: conceptual
88
ms.custom:
9-
ms.date: 10/07/2019
9+
ms.date: 01/24/2020
1010
ms.author: tapanm
1111
ms.reviewer:
1212
---
@@ -15,6 +15,72 @@ ms.reviewer:
1515

1616
Template tags control the output of a template in various ways, and allow the combination of multiple templates into a single output.
1717

18+
## fetchxml
19+
20+
Allows user to query data from CDS and render the results in a page.
21+
22+
> [!NOTE]
23+
> You can learn more about querying the data using fetchxml at [use FetchXML to query data](https://docs.microsoft.com/powerapps/developer/common-data-service/use-fetchxml-construct-query).
24+
25+
```
26+
{% fetchxml resultVariable %}
27+
<!— Fetchxml query -->
28+
...
29+
{% endfetchxml %}
30+
```
31+
32+
### Results attribute
33+
34+
Results attribute in provided variable (such as 'resultVariable' in above sample) holds FetchXML query results and a few other attributes.
35+
36+
- *Entities*
37+
38+
This attribute contains the result of fetchxml query. You can iterate the result and use it in your webtemplate.
39+
40+
```
41+
<table>
42+
{% for entityVariable in resultVariable.results.entities %}
43+
<tr>
44+
<td>Attribut-1: {{ entityVariable.attribute1 }}</td>
45+
<td>Attribut-2: {{ entityVariable.attribute2 }}</td>
46+
</tr>
47+
{% endfor %}
48+
</table>
49+
```
50+
51+
- *EntityName*
52+
53+
Gets the logical name of the entity.
54+
55+
- *ExtensionData*
56+
57+
Gets the structure that contains extra data.
58+
59+
- *MinActiveRowVersion*
60+
61+
Gets the lowest active row version value.
62+
63+
- *MoreRecords*
64+
65+
Gets whether there are more records available.
66+
67+
- *PagingCookie*
68+
69+
Gets the current paging information.
70+
71+
- *TotalRecordCount*
72+
73+
Gets the total number of records in the collection. <br/>
74+
ReturnTotalRecordCount was true when the query was executed.
75+
76+
- *TotalRecordCountLimitExceeded*
77+
78+
Gets whether the results of the query exceeds the total record count.
79+
80+
### XML attribute
81+
82+
XML attribute in provided variable (such as 'resultVariable' in above sample) holds the resultant query which can be used to get data from Common Data Service. This attribute is useful for debugging purpose when you want to understand how entity permission is getting applied on this *fetchxml* tag.
83+
1884
## include
1985
2086
Includes the contents of one template in another, by name. In Power Apps portals, the source of this other template will generally be a [web template](store-content-web-templates.md). This allows for the reuse of common template fragments in multiple places.

0 commit comments

Comments
 (0)