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.
We created below flow.
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.
Can anyone please help here?
Thanks, in advance!
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
Michael E. Gernaey
497
Super User 2025 Season 2
David_MA
436
Super User 2025 Season 2
Riyaz_riz11
244
Super User 2025 Season 2