Hello!
I am struggling with the following problem: In the flow below, I am using the "Populate Word Template" Action, which outputs the following:
When I use the "Create File" (sharepoint) action and feed the output of the "Template" action directly into its "file content" field, it works fine.
The thing I am trying to do is feed the output from the "Template" action into a clean array variable first, and then feed the variable to the "Create File" action.
The file is created this way, but is corrupted and cannot be opened.
Below is a print of the flow:
It corrupts the document when I replace the "Word Body" with the array variable.
Can anyone share some insights on what I am doing wrong?
Thanks in advance!
Tried that before... the problem is that the variable must be STRING in order to be selectable as dynamic content for the "file content" field of the "Create File" action.
And, being a string variable, the output of the "template" action doesnt show up in the dynamic content of the "set variable" action, as the output is seen as an array.
The point of all this is because I have a switch action that selects a template depending on a FORMS answer.
My goal is to put these templates outputs all in the same variable (depending on which template was selected by the switch) and then have a single "create file" action with the variable, after the switch action,
Instead, I could build one "create file" action for each template inside the switch after each template, but this feels extremally suboptimal. Nevertheless, I feel like this is going to be the way to go, unfortunately...
Thanks very much for the help, and I am more then willing to explore any other suggestions you may have!
What happens if you just place the output of the template action in the variable out right instead of renaming it to Body/Content?
Typically templates require several pieces of information to apply the values proper. Appending the content would not typically contain the template schema.
Thank you, @AWorley , for the fast and insightful reply.
I tried the following:
As you can see, I simply renamed the action and used your suggested expression to feed the contents into the string variable.
But, for some reason, the expression outputs blank:
Which is curious, as the "TemplateM001" action returns the following schema:
Can you provide any additional insights?
Thanks!
You need to pass the "content" variable from the body instead of the Body itself, as the content is expected to be a string?
I believe the expression would be : outputs('Populate_a_Microsoft_Word_template')?['body/content']
Also when i load that action I do not have access to the body attribute itself but the
Also I noticed that you are passing the Body attribute both in the array value and the Create file. So you may want to do the array value instead of Body.
Pstork1
20
Most Valuable Professional
rpersad
16
Michael E. Gernaey
12
Super User 2025 Season 1