cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
phildrake198
Helper III
Helper III

Using Populate a Microsoft Word Template more than once in a flow

Hi,

 

I'm using the Populate a Microsoft Word Template action and it's working great, except that I have a few conditions in my flow where I need to populate a word template based on that condition and what I'm finding is it doesn't look like there's a way to have it populate a template and reference that action later in the series. For example, let's say I have a condition where it's populating a template based on some field values but I need to add an additional condition later in the flow and also populate that same template later. Is there a way to have it recognize both of those populate a microsoft word template actions when I go to tell it to create the file at the end? I'm trying to keep from creating more than one word file. I hope this makes sense.

 

Thanks!

2 ACCEPTED SOLUTIONS

Accepted Solutions
Pstork1
Dual Super User
Dual Super User

Once you've populated the template it's populated and you can't go back and re-populate some of it.  Instead I would suggest creating variables to hold the values you want to populate as you go through your logic and then populate the template with all those values at the end.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

You initialize a variable somewhere at the top of your flow and then use Set Variable (or append to string variable) inside the condition to change the value of the variable.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

8 REPLIES 8
Pstork1
Dual Super User
Dual Super User

Once you've populated the template it's populated and you can't go back and re-populate some of it.  Instead I would suggest creating variables to hold the values you want to populate as you go through your logic and then populate the template with all those values at the end.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Hi @Pstork1 

 

Thanks. Yes that's the approach I've taken so far, it's just a little tedious because you have to use a variable and write out the conditional logic instead of using the visual Conditional Control.

I'm not sure I get why you have to write out the conditional logic.  Just replace the earlier spots in the flow where you populate the template with actions to set variables instead.  Then use the variables in the template later.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Here's what I mean: At a certain point earlier in my flow, I have a Conditional Control where it's a really long condition. Lots of ORs and ANDs and so on where it's checking for values for fields back in Dynamics. When I realized that I could only use Populate a Microsoft Word Template once in the flow, I decided to use variables instead but I thought I had to write out the expressions in that dynamic content area in order to create the variable. Are you saying there is a way to somehow turn that conditional control logic into a variable without building the expression for it manually? I'm new to variables so this may just simply be me making something more tedious than it needs to be.

No, if you were using expressions before for your logic you'll need to keep using them.  I thought you had conditional actions in your Flow and then had the populate template action under either the Yes or No.  If that had been the case then you could have just replace that action with a series of actions that stored the dynamic content you were putting into the template in a variable or variables to be used later.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Actually I do have a condition action at one point in my flow where I had added the Populate a Microsoft Word Template action under "Yes". Right now it's simply populating some fields in the word template based on that condition if that condition is True. What actions would I use to store those dynamic values within a variable instead? I see I can "Set Variable" but I can't "Initialize Variable" as an action under "Yes".

You initialize a variable somewhere at the top of your flow and then use Set Variable (or append to string variable) inside the condition to change the value of the variable.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

This worked. Thank you!

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Users online (1,368)