Update / copy View from another View #4615
Unanswered
LukasSchauffele
asked this question in
Q&A
Replies: 1 comment
-
Could you try without the
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone,
I'm trying to copy a 'View' from a central template SharePoint site to hundreds of 'project sites'. I've encountered a few issues and would appreciate any guidance.
Here's what I've tried so far:
I used the
Invoke-PnPSiteTemplate
command, but it copies the entire list, which causes other issues. I couldn't find a handler that only copies views.I attempted to use
Get-PnPView
to retrieve the view from the template. However, I could only get the Title, not the actual XML query that makes up the view:Direct XML Copy:
I tried copying the XML directly by exporting the template and finding the View, but the following command results in a broken view:
I'm also looking for a way to change the URL of a view programmatically. In the GUI, I can change the name before .aspx to update its URL. However, when I tried setting the ServerRelativeUrl using the following command:
Set-PnPView -List $list -Identity $siteView.Id -Values @{ServerRelativeUrl=$newUrl} -Connection $siteConnection
I received this warning:
I feel like I'm missing something obvious. Any suggestions on how to achieve this without copying the entire list or ending up with a broken view?
Thanks in advance for your help!
Beta Was this translation helpful? Give feedback.
All reactions