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?
Hi @sarahpoulin
So looking at this example below; i understand you want to populate the Items Array?
You have to Initialize an array variable as below
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
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.
Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!
User | Count |
---|---|
85 | |
57 | |
42 | |
38 | |
33 |
User | Count |
---|---|
91 | |
73 | |
72 | |
60 | |
40 |