Showing results for 
Search instead for 
Did you mean: 
New Member

InvalidTemplate error message in "append to array variable" function. Using word connector to populate MS Word template from sharepoint list data.

I am currently trying to build a flow that populates a MS Word template (with some repeating sections in the template) with data from a SharePoint list. The items in the SharePoint list are a list of projects. I am using the "word business online word connector" to populate the template and the 'Get Items' function to retrieve data from the SharePoint list. The template has four sections that are to be repeated based on the number of SharePoint items value(column). In this case  the value that is being evaluated is the 'status' of a project. So depending on the status of the project, the flow is supposed to select the section that corresponds to that status and populate it with SharePoint data. This way when the word output file is generated there will be multiple populated sections of the template for each respective project status.
Project status 1 -Section1 of template (populate this section of the template for the number of items in the SharePoint list that are in Project status 1)
Project status 2 -Section2 of template (populate this section of the template with all items from the SharePoint list that are in Project status 2)
And so on until section4 and project status 4.
I am using the 'append to array variable' function to connect areas within each section of the template to specific columns in the SharePoint list. When I run the flow I get the below error message. I have tried resaving the flow and re-opening my browser as suggested in other posts but I am still receiving this same error message. Any ideas how I can resolve?
"InvalidTemplate. Unable to process template language expressions in action 'Append_to_array_variable_3' inputs at line '1' and column '31920': 'The template language expression 'body('Format_number')?['body']' cannot be evaluated because property 'body' cannot be selected. Property selection is not supported on values of type 'String'. Please see  for usage details.'"

Community Support
Community Support

Hi @kijja ,


Could you please share the full screenshot of the configuration of the flow and the run history of the flow so I could better understand and reproduce your issue to provide a proper workaround?


Best Regards,



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

Append to Array variableAppend to Array variableAppend to Array variable2Append to Array variable2run historyrun historyset variables for Null values in Sharepoint listset variables for Null values in Sharepoint listSwitch to appropriate screen.PNG

Hi Alice, 


Thank you for your response. I attached a number of screenshots. Please let me know if I missed anything that you would like to see . 

Helpful resources

MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Top Solution Authors
Users online (4,023)