cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
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.

Helpful resources

Announcements
Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Users online (55,183)