How to use Create HTML Table block in Azure Logic Apps to format JSON data

Sometimes after extracting data from certain data sources in JSON format we have to format and make this data easily readable so as to send this data via Microsoft teams or email. In this blog I will format a sample JSON code into a HTML table

Since I am not using a data source, I am initializing a variable with data type as array (Create HTML block supports array Variables) and put a sample JSON code in the value section.

Now we will convert this JSON piece of code into respective HTML type, to do this we will use Create HTML block, we have to select the array variable we initialized earlier and the type of columns would be custom.

Enter Header details, this can be any string value, For Value Field Click on on it, go to expression and type the following expression.

item()?[‘Product_ID’]

You can replace the “Product_ID” with the name of attribute in JSON string

After this we will send this data via email and run the trigger.

As you can see the JSON code is converted into readable Email via HTML

Hope this blog helped.


Share Story :

Secured By miniOrange