cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
v-prasaddas
Microsoft
Microsoft

Word Templates not showing up in SharePoint/Teams after being added via PowerAutomate

We have been trying to setup a flow that automatically mirrors (read: copies and creates new) Word templates from one Teams Channel to another. The goal is to have them appear in the "+ New" dropdown in SharePoint and Teams.

vprasaddas_0-1674628565142.png

We created below flow.

vprasaddas_1-1674628609098.png

 

However, after successfully running the flow, the word file does not show up in the "+ New" dropdown. When we try to manually add the same file via the "+ New" dropdown, it shows a message that a file with that name already exists.

vprasaddas_2-1674628637799.png


Can anyone please help here?
Thanks, in advance!

1 ACCEPTED SOLUTION

Accepted Solutions
v-xiaochen-msft
Community Support
Community Support

Hi @v-prasaddas ,

 

I turned on the browser develop mode and captured webapi.

I guess it performs two step.

1\ Upload the template file to forms folder.

2\ Update the current View and make the template file to be visible in "+ New" dropdown.

 

In your flow, you completed the first step perfectly.

So please call an api to complete the second step.

 

Post api- api/web/GetList(@a1)/DefaultView/SetViewXml()?@a1=%27%2Fsites%2Fwearsky%2FTestGG%27

If I decode the 'ai', it should be '/sites/wearsky/TestGG'.

// wearsky is the site name and TestGG is the library name. When you call the api, please remember encode it.

 

Payload:

{
  "viewXml": "<View Name=\"{***************}\" DefaultView=\"TRUE\" MobileView=\"TRUE\" MobileDefaultView=\"TRUE\" Type=\"HTML\" DisplayName=\"All Documents\" Url=\"/sites/wearsky/TestGG/Forms/AllItems.aspx\" Level=\"1\" BaseViewID=\"1\" ContentTypeID=\"0x\" ImageUrl=\"/_layouts/15/images/dlicon.png?rev=47\"><Query><OrderBy><FieldRef Name=\"FileLeafRef\"/></OrderBy></Query><ViewFields><FieldRef Name=\"DocIcon\"/><FieldRef Name=\"LinkFilename\"/><FieldRef Name=\"Modified\"/><FieldRef Name=\"Editor\"/><FieldRef Name=\"ID\"/><FieldRef Name=\"_x7b7e__x6838__x72b6__x6001_\"/><FieldRef Name=\"Test\"/><FieldRef Name=\"Test_Pic\"/><FieldRef Name=\"Test_Metadata\"/><FieldRef Name=\"CC\"/><FieldRef Name=\"sdf\"/><FieldRef Name=\"Created\"/></ViewFields><RowLimit Paged=\"TRUE\">30</RowLimit><JSLink>clienttemplates.js</JSLink><XslLink Default=\"TRUE\">main.xsl</XslLink><CustomFormatter/><NewDocumentTemplates>[{\"templateId\":\"NewFolder\",\"title\":\"Folder\",\"visible\":true},{\"templateId\":\"NewDOC\",\"title\":\"Word document\",\"visible\":true},{\"templateId\":\"NewXSL\",\"title\":\"Excel workbook\",\"visible\":true},{\"templateId\":\"NewPPT\",\"title\":\"PowerPoint presentation\",\"visible\":true},{\"templateId\":\"NewONE\",\"title\":\"OneNote notebook\",\"visible\":true},{\"templateId\":\"NewXSLSurvey\",\"title\":\"Excel survey\",\"visible\":true},{\"templateId\":\"NewXSLForm\",\"title\":\"Forms for Excel\",\"visible\":true},{\"templateId\":\"NewVSDX\",\"title\":\"Visio drawing\",\"visible\":true},{\"contentTypeId\":\"0x010100D6B49F9E00314D459014EBB1CABBC920\",\"isUpload\":true,\"templateId\":\"Book3 (1)\",\"title\":\"Book3 (1)\",\"url\":\"/sites/wearsky/TestGG/Forms/Book3 (1).xlsx\",\"visible\":true}]</NewDocumentTemplates><Toolbar Type=\"Standard\"/></View>"
}

// Let's say you have uploaded the file named 'Boo3 (1)', make sure the visible property is true.

 

Best Regards,

Wearsky

View solution in original post

1 REPLY 1
v-xiaochen-msft
Community Support
Community Support

Hi @v-prasaddas ,

 

I turned on the browser develop mode and captured webapi.

I guess it performs two step.

1\ Upload the template file to forms folder.

2\ Update the current View and make the template file to be visible in "+ New" dropdown.

 

In your flow, you completed the first step perfectly.

So please call an api to complete the second step.

 

Post api- api/web/GetList(@a1)/DefaultView/SetViewXml()?@a1=%27%2Fsites%2Fwearsky%2FTestGG%27

If I decode the 'ai', it should be '/sites/wearsky/TestGG'.

// wearsky is the site name and TestGG is the library name. When you call the api, please remember encode it.

 

Payload:

{
  "viewXml": "<View Name=\"{***************}\" DefaultView=\"TRUE\" MobileView=\"TRUE\" MobileDefaultView=\"TRUE\" Type=\"HTML\" DisplayName=\"All Documents\" Url=\"/sites/wearsky/TestGG/Forms/AllItems.aspx\" Level=\"1\" BaseViewID=\"1\" ContentTypeID=\"0x\" ImageUrl=\"/_layouts/15/images/dlicon.png?rev=47\"><Query><OrderBy><FieldRef Name=\"FileLeafRef\"/></OrderBy></Query><ViewFields><FieldRef Name=\"DocIcon\"/><FieldRef Name=\"LinkFilename\"/><FieldRef Name=\"Modified\"/><FieldRef Name=\"Editor\"/><FieldRef Name=\"ID\"/><FieldRef Name=\"_x7b7e__x6838__x72b6__x6001_\"/><FieldRef Name=\"Test\"/><FieldRef Name=\"Test_Pic\"/><FieldRef Name=\"Test_Metadata\"/><FieldRef Name=\"CC\"/><FieldRef Name=\"sdf\"/><FieldRef Name=\"Created\"/></ViewFields><RowLimit Paged=\"TRUE\">30</RowLimit><JSLink>clienttemplates.js</JSLink><XslLink Default=\"TRUE\">main.xsl</XslLink><CustomFormatter/><NewDocumentTemplates>[{\"templateId\":\"NewFolder\",\"title\":\"Folder\",\"visible\":true},{\"templateId\":\"NewDOC\",\"title\":\"Word document\",\"visible\":true},{\"templateId\":\"NewXSL\",\"title\":\"Excel workbook\",\"visible\":true},{\"templateId\":\"NewPPT\",\"title\":\"PowerPoint presentation\",\"visible\":true},{\"templateId\":\"NewONE\",\"title\":\"OneNote notebook\",\"visible\":true},{\"templateId\":\"NewXSLSurvey\",\"title\":\"Excel survey\",\"visible\":true},{\"templateId\":\"NewXSLForm\",\"title\":\"Forms for Excel\",\"visible\":true},{\"templateId\":\"NewVSDX\",\"title\":\"Visio drawing\",\"visible\":true},{\"contentTypeId\":\"0x010100D6B49F9E00314D459014EBB1CABBC920\",\"isUpload\":true,\"templateId\":\"Book3 (1)\",\"title\":\"Book3 (1)\",\"url\":\"/sites/wearsky/TestGG/Forms/Book3 (1).xlsx\",\"visible\":true}]</NewDocumentTemplates><Toolbar Type=\"Standard\"/></View>"
}

// Let's say you have uploaded the file named 'Boo3 (1)', make sure the visible property is true.

 

Best Regards,

Wearsky

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (3,107)