Showing results for 
Search instead for 
Did you mean: 
Super User
Super User

Create a HTML table from Dynamics 365/ CDS data (accessing data from related fields too)



In this post we will build a flow to create a HTML table from Opportunity entity. One of the requirements is to get the Account Name in a column. 

The account field is a lookup and references to the GUID when referred to fromthe opportunity entity. We will see how we can access the account field label (accountid). 


1. Select the trigger of your choice. 

2. Select the action "List records from Dynamics 365" -> Select the organization and select the Opportunitites entity. -> write any custom queries as you want

3. Initialise an array variable with null value

4. Select an apply to each condition and select the "value: list of records" from the dynamics content as an input to the loop

5. Within the loop, add the Get Records from Dynamics 365 action -> Select the organization -> Select the "Account Entity" -> Select the "Account" field from the dynamic content list of "List of records" option.  // this step can be replicated for any related entity, ensure using the appropriate record identifier to access the record. 

6. Within the loop, add the Append to Variable Array action -> Select the arra you initialised -> in the values part type the json and select appropriate values (refer to the screenshot)

"Account Name": (select the Account Name option from the Get Records list in the dynamic content selector), 

"Opportunity Topic" : (select the Topic option from the List Records list in the dynamic content selector)

(repeat the same steps as above for all the desired fields)


7. Now add a new step out of the loop and select the create a HTML table option -> select the array in the from option of the create HTML table ation. 




If this post has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!