How To Display An Entity List Using Fetch XML And Liquid Code For A More Custom Portal Page With Microsoft Power Apps

Sending
User Review
0 (0 votes)

Rachel Lowenstein here with part my Microsoft Power Apps Portal Pages How To Series. This series looks at how to display an Entity List using Fetch XML and Liquid Code for a more custom Portal Page.

Sometimes, the out of the box way for styling entity lists is not the prettiest. The following steps show you how to style your data from CRM to build out a more custom portal with HTML and CSS.

Building your Fetch XML query within CRM using Power Apps

First, you will want to create your Fetch XML query.

NOTE: You can use the Fetch XML builder through XRM Toolbox, or through the advanced find in D365 CRM

  • You can find the advanced find by clicking the gear icon in the top right navigation of your CRM environment. Select Advanced Settings.
  • In the new window, navigate again to the top right of your navigation and select the funnel icon 
  • Once selected, a new window will appear.
  • From there, you will select the table and add the attribute columns you want displayed on the portal. You can choose the attribute columns by selecting, “Edit columns”.
  • Within the next window, select the columns you want to bring in the portal by selecting, “Add Columns”.
  • After you select all your columns, select “OK”.
  • Next, navigate to the top bar of the advanced find window. Select, “Download Fetch XML”.
  • After a few seconds, the file will show up at the bottom of the advanced find screen. Open the file.

Building the layout from the data returned by the Fetch XML query in Power Apps

Second, in your preferred code editor, add the Fetch XML.

  • Surround the Fetch XML by placing the following liquid tags in your editor:
  • {% fetchxml enterANameHere %} – before the Fetch XML
  • {% endfetchxml %} – after the Fetch XML
  • You will be able to pull all the records that meet your Fetch XML criteria.

NOTE: Filtering example can be found below
See below for iterating through the records with simple html below. You will need to keep the defining ‘result’ from the example.results.entities Fetch XML and ensure the ‘result.’ is before the schema names within the div tags.

From here, you will be able to view the results on your portal page.

If you have a link entity, you will need to bring in the linked entity fetchxml within the fetch. Based off the alias name, you will need to bring the result in by coding:

{{result[‘alias name’.schema name’]}}

See example below:

With this information, you will be able to design bootstrap cards, grid tables or any other custom HTML you will want to bring into your portal.

Let us know what scenarios this feature would help you with; we are always excited to hear from our clients and their success stories using Microsoft products.

By Rachel Lowenstein, Dynamics 365 Technical Consultant

Working with New Dynamic

New Dynamic is a Microsoft Solutions Partner focused on the Dynamics 365 Customer Engagement and Power Apps. Our team of dedicated professionals strives to provide first-class experiences incorporating integrity, teamwork, and a relentless commitment to our client’s success.

Contact Us today to transform your sales productivity and customer buying experiences.

The post How To Display An Entity List Using Fetch XML And Liquid Code For A More Custom Portal Page With Microsoft Power Apps appeared first on CRM Software Blog | Dynamics 365.

Leave a Reply