Hi,
I am running into an unusual issue when using Apply To Each to capture multiple related records and populating a Word template that includes the Repeating Content Control. What's happening is my values from Apply To Each are getting "duplicated" in the table in Word. So instead of the correct related records, it's showing the first record values repeating in the table. My flow runs "successfully" so I can see where the related record values are getting captured but I can't figure out why the values are getting duplicated instead of repeating the unique values like I think it should. Here are some screenshots for clarity. Is there any way around this? Possibly a way to do this without the "Apply to Each" action?:
Solved! Go to Solution.
I did tried this and it is working as expected.
Could you please try the following:
1. Change the array structure as following:
Product Part Number 1 to ProductPartNumber
Description 1 to Description
Quantity1 to Quantity
Rebate1 to Rebate
2. Make sure Populate word template is outside the apply each loop
3. Open the word template.
4. Remove the current table.
5. Save the template.
6. Add a new table x 4 rows
7. Add the heading
8. Press tab (this should create new row)
9. Highlight the whole row and add repeater control
10. Select properties of the repeater control and add the name as ProductDetails and set the tag as same name.
11. Next place your cursor in first cell of the second row, add a text box, select properties and set name and tag as ProductPartNumber.
12. Move the cursor to next column. Repeat the same as step 11 for Description, Quantity and Rebate.
13. Next back to flow again and remove the current word template step.
14. Add word template again and click the T sign, this will join all the columns into one. Here place your array variable.
15. Save and run the flow.
Let me know how it goes.
If you liked my response, please consider giving it a thumbs up
Proud to be a Flownaut!
Learn more from my blogHi!
Can you share an screenshot from your flow design, so we can see the input to Apply to each etc?
The more context info we hve, the fastest to get a useful answer
Thanx!
Proud to be a Flownaut!
Please make sure you followed the below instructions:
We're enabling repeating tables in the Word Online connector. When creating a template in Word, you need to add the Repeating Section Content Control. This is the control in the developer tab that helps us create a repeating table. Repeating Section Content Control enables users to repeat rows in a table and plain text. Here is a guide to work with the Repeating Section Content Control:
To make a template with repeating text: First add a Repeating Section Content Control from the developer tab. Then add Plain Text Content Controllers within the parent repeat content controller. Any text that is outside a nested content controller would be static. While adding the nested content controllers, make sure to go to properties and add a unique title for them. For example, if the template looks like I would like to a and b Then the user can dynamically change the values of a and b.
To add a repeating row to the template, simply add a table, select the full row (which you want to repeat) and select the repeat content controller from the developer tab. Now you can add nested plain text content controllers in the columns that you want to be dynamic. While adding the nested content controllers, make sure to go to properties and add a unique title for them.
If you liked my response, please consider giving it a thumbs up
Proud to be a Flownaut!
Learn more from my blogSure. Here's some more detail that will hopefully be helpful. What I'm trying to do is have it pull values from related records in Dynamics and then put those values in a table that uses a repeating content control in Word. The challenge is, when you use "Apply to Each", you can't pull values from within that Apply to Each in the Populate a Microsoft Word Template action. So what I've done to work around this is initialize a variable outside of that Apply to Each and then use "Append to Array" within the Apply to Each to call that "initialize variable". Then, in "Populate a Microsoft Word template", I can "switch to array" on the repeating content control fields and then add the variable. The problem I'm running into is it just doesn't add second set of values even though they are returned in the results.
Here are some screenshots of the flow logic for more detail. Maybe I'm doing something wrong:
Did you do the following?
While adding the nested content controllers, make sure to go to properties and add a unique title for them.
Thanks
If you liked my response, please consider giving it a thumbs up
Proud to be a Flownaut!
Learn more from my blogYes I added titles for the controls, although I did notice that I forgot to add a title for the repeating control. So I went back and did that but it still doesn't display the data beyond that first set of values. I made sure to add my file back in and made sure the Populate a Microsoft Word Template action was updated to call the updated file. Based on what I've described, is there anything else that needs to be done here?
I did tried this and it is working as expected.
Could you please try the following:
1. Change the array structure as following:
Product Part Number 1 to ProductPartNumber
Description 1 to Description
Quantity1 to Quantity
Rebate1 to Rebate
2. Make sure Populate word template is outside the apply each loop
3. Open the word template.
4. Remove the current table.
5. Save the template.
6. Add a new table x 4 rows
7. Add the heading
8. Press tab (this should create new row)
9. Highlight the whole row and add repeater control
10. Select properties of the repeater control and add the name as ProductDetails and set the tag as same name.
11. Next place your cursor in first cell of the second row, add a text box, select properties and set name and tag as ProductPartNumber.
12. Move the cursor to next column. Repeat the same as step 11 for Description, Quantity and Rebate.
13. Next back to flow again and remove the current word template step.
14. Add word template again and click the T sign, this will join all the columns into one. Here place your array variable.
15. Save and run the flow.
Let me know how it goes.
If you liked my response, please consider giving it a thumbs up
Proud to be a Flownaut!
Learn more from my blogOk that did solve the additional record values not showing up. The problem now though is both record values are being duplicated in the word doc in that table. Is yours pulling the record values from Dynamics like mine is and if so how did you get it to not duplicate? My Populate a Microsoft Word Template action is outside of that Apply to Each condition so I'm not sure why it's duplicating the values in the doc. Or is there some expression I can add that will resolve the duplicates?
Make sure your arrays have no duplicates. It's difficult to see without checking the runtime history and your template. I did send you an email earlier. Please check it.
Thanks
If you liked my response, please consider giving it a thumbs up
Proud to be a Flownaut!
Learn more from my blogThank you! Yes, It duplicated because there was an additional "Apply to Each" at the beginning of the condition. So it was an "Apply to Each" within an Apply to Each. Once I removed that extra action, it worked.
I had a similar problem and ended up looking at the word template. I changed the docx extension to zip and inspected the xml files. It appears that when the malfunction happens the file settings.xml file had a line for the formsDesign class.
When I deleted the line and replaced the settings.xml all content shows correctly.
Hope this helps anyone.
User | Count |
---|---|
90 | |
41 | |
22 | |
20 | |
16 |
User | Count |
---|---|
134 | |
54 | |
47 | |
36 | |
25 |