-
Notifications
You must be signed in to change notification settings - Fork 643
ApplyProvisioningTemplate creates duplicate views #2540
Comments
Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible. |
Hi Karine, Does it occur for all list instances in your template or a specific one? |
I cleaned up your template, and limited it to one list, Correspondenties, which seemed to one you reference in your screenshot? It works as expected for me. The logic behind the scenes that we use (and there is unfortunately no way around that) is that we use the -title/displayname- of the view to determine if the view is present. If present we will delete that view and recreate it. What is the default title of the existing view? Is there something going on by the site being created in a different language and as such the title of the view is different from what is being presented to the user? |
Hi Erwin, are you sure that in your code you don't check on "All documents" for example? Because the standard view in our template site is "Alle documenten", just as in the template XML. When the new site is created, the default view is also "Alle documenten". |
this is the check we do: var viewTitle = parser.ParseString(displayNameElement.Value);
var existingView = existingViews.FirstOrDefault(v => v.Title == viewTitle);
if (existingView != null)
{
existingView.DeleteObject();
web.Context.ExecuteQueryRetry();
} parseString is our internal code that replaces tokens in strings for the actual values. We also have a 'RemoveExistingViews' attribute on the pnp:Views element that you didn't set. Can you try that one? <pnp:Views RemoveExistingViews="true">
<View DisplayName="View One">
<ViewFields>
<FieldRef Name="ID" />
etc. etc. |
regarding the language: is the site created as as Dutch site? Or is it created as an English site and has Dutch enabled? If you use PnP PowerShell and do Get-PnPView -List 'yourlistname' Do you also get 'Alle documenten' back? |
Hi Erwin, Tomorrow, I'll try to use the RemoveExistingViews attribute, and I'll let you know. |
Hi Erwin, |
We use ApplyProvisioningTemplate to provision new SharePoint sites. The template XML contains XML like this (generated by the method GetProvisioningTemplate):
30
clienttemplates.js
etc.
We expect the default view to get the custom fields, but instead a duplicate view is created:
Tenant and SharePoint sites have "Dutch" regional settings.
Which PnP repository should you use to report the issue?
Category
[ ] Bug
Environment
[ ] Office 365 / SharePoint Online
CustomProjectTemplate_TEST.txt
The text was updated successfully, but these errors were encountered: