cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JoshB
Level: Powered On

Populate A Word Template Sort Order

I am trying to build a flow that will populate a word template.  I have quite a few content controls in the form.  The issue is they seem to populate in to flow in a random order.  Is there a way I can have them populate alphabetically, or in the order they appear in the word document that is being used as the template?  Or even just a way to assign a manual order for them to appear.  In the screenshot the first field Day1Day appears a ways into my word document, the BreakfastDetails3 shows up towards the end of the document, then MainPOCName shows up back towards the beginning of the document. 

 

https://ibb.co/vLHS00Z

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Populate A Word Template Sort Order

Hi @JoshB ,

 

Thanks for updating. The issue you mentioned could be reproduced by me.

 

The order you’ve specified on the word template appear in a random order on Flow.

 

Please feel free submit your request on Flow Ideas Forum so that it could be taken into consideration in future releases:

https://powerusers.microsoft.com/t5/Flow-Ideas/idb-p/FlowIdeas

 

I will suggest other customers who have the same request to vote your idea as well.

 

Best regards,

Mabel

 

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Highlighted
Super User
Super User

Re: Populate A Word Template Sort Order

Please review the Populate a Microsoft Word Template documentation, including the Guide for using Repeating Section Content Control in the Word Online connector entry which states: 

 

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:

  1. 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.

  2. 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.

  3. Once you have added a Repeating Section Content Control, the nested content controllers would show up in the Word connector action. You can click on the "Add new item" button to add a new row. If the number of rows you want is dynamic, then user should make a array of values and pass it into the repeat field. For example, a valid array for the above example would look like: [{"a": "value for row 1", "b": "value for row 1"}, {"a": "value for row 2", "b": "value for row 2"}] Here the keys of the objects are the titles of the nested content controllers. Hence, adding a unique title is necessary. This array can be easily constructed using an array variable and "Append to array variable" action.

Additional notes:

  • To format the table simply format the text and table in the template and the formatting would persist in the generated document.
  • If there is no title for a nested content controller in repeat, it would be get a random title.
  • If there is a duplicate title, both the content controllers will be replaced with the same content

As outlined in 1. of the information above, the order of the data in the Word template is determined by the content controls, and/or nested content controls. For more about structured Word documents and content controls, please see the Content Controls in Word documentation

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

JoshB
Level: Powered On

Re: Populate A Word Template Sort Order

I am not having any issues with repeating content (I actually don't need this in this form.)  However when I bring the form into flow via Populate A Word Template the content control fields from the form are in a random order.  I would like for them to appear in the order they appear on the word document itself, or at least alphabetically by tag or name.  The screenshot I posted previously shows the current order the content controls appear in flow.  Which appears to be randomized. 

Community Support Team
Community Support Team

Re: Populate A Word Template Sort Order

Hi @JoshB ,

 

Thanks for updating. The issue you mentioned could be reproduced by me.

 

The order you’ve specified on the word template appear in a random order on Flow.

 

Please feel free submit your request on Flow Ideas Forum so that it could be taken into consideration in future releases:

https://powerusers.microsoft.com/t5/Flow-Ideas/idb-p/FlowIdeas

 

I will suggest other customers who have the same request to vote your idea as well.

 

Best regards,

Mabel

 

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 183 members 4,499 guests
Please welcome our newest community members: