Create HTML table by combining columns from multiple entities

Creating an HTML table in Power Automate is a very commonly used action. Building the HTML table using attributes from a single entity is quite simple and straightforward. However, when it comes to including columns from multiple entities, it requires some extra brainstorming!

First, let’s understand how the "Create HTML Table" step works.


The "Create HTML Table" step expects an array of objects in the From column. It provides the option to add static table column headers and dynamic table contents. Alternatively, you can let the system handle it automatically.

In our case, we are going to create an HTML table by selecting columns from both the Contact and Account entities. From Contact, I will choose the First Name, Last Name, and Email fields, while the Company field will come from the Account entity.

Since the "Create HTML Table" step expects an array of objects, we need to create the array with the required fields. To obtain the company name, we'll use the "Get a Row by ID - Account" step. Once all the required fields are obtained, they are appended to an array variable.


The schema of object is as follows:
{
    "Name": "<dynamic content>",
    "Value": "<dynamic content>"
}

The array variable can be passed to the "Create HTML Table" step. Setting the columns to Automatic will create a table with all the column headers based on the keys provided in the object schema.


The resultant table will be as follows:












Comments

Popular posts from this blog

Dynamics 365 CRM Form Switching: A Deep Dive into formSelector and navigate()

Create and Send Emails with Attachments in D365/Dataverse with Power Automate