Replies: 3 comments 1 reply
-
Hi @KoenZomers, can you please look into it? |
Beta Was this translation helpful? Give feedback.
-
Moving this to a discussion, most likely some issue with your formatting JSON. Please check these links to properly format it: https://pnp.github.io/script-samples/spo-list-formatting/README.html?tabs=pnpps or https://beaucameron.com/2020/06/01/json-column-formatting-name-cannot-begin-with-the-character/ |
Beta Was this translation helpful? Give feedback.
-
I have the same issue. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Reporting an Issue or Missing Feature
I am reporting a bug
Expected behavior
Set-PnPView should apply a custom formatting to existing modern SharePoint gallery type view.
Actual behavior
I am currently trying to apply a custom Json formatting to existing gallery type view. I first connect to my SharePoint site with Connect-PnPOnline (Tried Interactive, WebLogin , Default & App-only tokens approach). After running Set-PnPView with custom Json, command is getting executed successfully. But not able to get desired formatted view.
Steps to reproduce behavior
$JSONFormat = @"
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/tile-formatting.schema.json",
"formatter": {
"children": [
{
"elmType": "div",
"style": {
"border-radius": "2px",
"box-shadow": "0px 1.6px 3.6px 0 #24, 0px 0.3px 0.9px 0 #24",
"font-weight": "800",
"height": "92%",
"overflow": "hidden",
"padding-left": "16px",
"padding-top": "16px",
"width": "95%"
},
"txtContent": "[$Title]"
}
],
"elmType": "div"
},
"height": "250",
"width": "350"
}
"@
Try
{
#Connect to site
Connect-PnPOnline -URL $SiteURL -UseWebLogin
#Set the View Formatting
Set-PnPView -List $ListName -Identity $ViewName -Values @{"CustomFormatter" =$JSONFormat.ToString()}
Write-host "View Format Applied Successfully!" -foregroundcolor Green
}
Catch {
write-host "Error: $($_.Exception.Message)" -foregroundcolor Red
}
What is the version of the Cmdlet module you are running?
PnP.PowerShell - 1.11.0
Which operating system/environment are you running PnP PowerShell on?
Beta Was this translation helpful? Give feedback.
All reactions