cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sarahpoulin
Helper I
Helper I

Populate HTML Template from Sharepoint List

I successfully was able to create a pdf from a docx template using a Sharepoint list: https://masteroffice365.com/booking-form-leveraging-powerapps-microsoft-word/

 

When I fill in fields in my PowerApp, it goes to Sharepoint Lists metadata, then a Sharepoint library with a docx template and copies the metadata over, then makes a pdf.

 

But I want to also simultaneously use the Sharepoint List metadata to populate placeholders in an html file. I also created a new flow and managed to create an html file from template using these Plumsail instructions: https://plumsail.com/docs/documents/v1.x/flow/how-tos/documents/create-html-from-template.html

 

But obviously I need some way to have the Sharepoint List data do the populating of the placeholders in the html file. I am having trouble getting clarity on the matter on how to do this. Also, my .docx is vastly different from my .html template. So I need the Sharepoint list to populate each.

 

Any suggestions? Maybe there is something that creates a JSON with the list data, and then automatically has that populate the html file?

1 REPLY 1
Mira_Ghaly
Dual Super User II
Dual Super User II

Hi @sarahpoulin 

So looking at this example below; i understand you want to populate the Items Array? 

Mira_Ghaly_1-1595060956569.png

You have to Initialize an array variable as below

Mira_Ghaly_2-1595061061157.png

Loop on your Sharepoint list and add a compose data operation action in the below format:

FieldValues

{
"Quantity": Variable from URL Sharepoint List,
"SubTotal": Variable from URL Sharepoint List,
"Title": Variable from URL Sharepoint List,
"Unit Price": Variable from URL Sharepoint List,
}

Then append the output of your Compose action to array you have initialized earlier

 
 

Appendtoarray.PNG

 

Then Construct a JSON object the Similar way using Compose Data Operation in this format:

{

Invoice: Variable,

Items: HERE Add output from your array

}

And pass it to the next steps that Generates the HTML.

 

Please check also my blog post on Populating Word Templates https://onlinemgblog.wordpress.com/2020/06/22/update-existing-word-templates-in-dynamics-356/ it is using the same approach/

 

If this helps you solve your problem, Please mark as accepted solution.

 

If this post helps you with your problem, please mark your as Accepted solution.If you like my response, please give it a Thumbs Up.

Blog: here

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Users online (2,956)