Using Liquid Templates and FetchXML to Retrieve and show Data in Power Portals

| Muhammad Yaseen

So, before we dive into the main context, firstly let’s understand a little about the Liquid Template and FetchXML.

Liquid Template is an Open-source template Language created by Shopify developer in Ruby. This Template was ported over to .NET in 2010 via Open-Source-License, it is basically used to load dynamic content on front.

FetchXML is a query language used in Dynamics 365 and in the Common Data Service. It’s expressed in an XML format with some aggregation capabilities, like sum, average, or total. This language supports filters upon the main entity but also filters upon linked entities. For example, a query upon the Contact entity can contain a filter to the Parent Account. Which we will be using here later on.

First of all, Goto Advance find button on Dynamics 365. And it will open a page where you generate your own fetchXML of your Data verse tables.

Environment-Variables-in-Canvas-Apps
Here on the Look For field you can select your desired table from your Environment and on below select option you can select the table column to apply filter and you can group these filters by selecting filters and click the group or /and clause according to the requirement.

Environment-Variables-in-Canvas-Apps

Environment-Variables-in-Canvas-Apps

Environment-Variables-in-Canvas-Apps

You can see the result by clicking on the result tab, and can download the fetchXML using the Download fetchXMl Button.

Environment-Variables-in-Canvas-Apps

To show the data in front you have to wrap this XML in liquid syntax and to iterate in your data you can also use loops in liquid syntax, you will have more idea on liquid syntax if you go through the documentation

Environment-Variables-in-Canvas-Apps

Sample Output.

Environment-Variables-in-Canvas-Apps

Join us next time, as we continue our journey of learning canvas apps.Click here to learn more about Imperium's Power Apps Services. We hope this information was useful, and we look forward to sharing more insights into the Power Platform world.


M
Chief Architect, Founder, and CEO - a Microsoft recognized Power Platform solution architect.

About The Blog

Stay updated with what is happening in the Microsoft Business Applications world and initiatives Imperium is taking to ease digital transformation for customers.


More About Us

We provide guidance and strategic oversight to C-Suite and IT Directors for on-going implementations. Feel free to give us a call.

1 331 250 27 17
Send A Message

Ready to Start?

Get a personalized consultation for your project.

Book a Meeting