PnP-Sites-Core
PnP-Sites-Core copied to clipboard
Apply PnPTemplate fails when a view contains a customFormatter
Thank you for reporting an issue or suggesting an enhancement. We appreciate your feedback - to help the team to understand your needs, please complete the below template to ensure we have the necessary details to assist you. If you have a actual question, we would ask you to use SharePoint Developer Group at Microsoft Tech Community. Thanks!
Category
[X] Bug [ ] Enhancement
Environment
[X] Office 365 / SharePoint Online [ ] SharePoint 2016 [ ] SharePoint 2013
Expected or Desired Behavior
Apply the template and the view custom formatter
Observed Behavior
Apply-PnPProvisioningTemplate : Name cannot begin with the '=' character, hexadecimal value 0x3D
Steps to Reproduce
In source site:
- Any list
- format current view
- Add the following formatting (if the item has not been updated since more than a 30 days, it will be highlighted'
{
"schema": "https://developer.microsoft.com/json-schemas/sp/view-formatting.schema.json",
"additionalRowClass": "=if([$Modified] + 2505600000 <= @now, 'sp-field-severity--severeWarning', '')"
}
- Export the template (Get-PnPProvisioningTemplate)
Destination Site:
- Import the generate template.
Thanks
Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.
Any Update on this Bug?
I will appreciate an update on this issue! I am also having exact same issue!
Any updates? I just ran into this issue as well.
My Format code is a lot different. It still says it is flagging the '=' sign though
<![CDATA[ { "additionalRowClass": { "operator": ":", "operands": [ { "operator": "<=", "operands": [ { "operator": "Date()", "operands": [ { "operator": "toDateString()", "operands": [ { "operator": "Date()", "operands": [ "[$Modified]" ] } ] } ] }, { "operator": "Date()", "operands": [ { "operator": "toDateString()", "operands": [ { "operator": "-", "operands": [ "@now", 15552000000 ] } ] } ] } ] }, "sp-css-backgroundColor-warningBackground40 sp-css-color-red sp-field-borderAllRegular sp-field-borderAllSolid sp-css-borderLeftColor-neutralPrimary sp-css-borderRightColor-neutralPrimary sp-css-borderTopColor-neutralPrimary sp-css-borderBottomColor-neutralPrimary", "" ] } } ]]>
I have the same issue. Based on my testing, the less or equal operator "<=" causes the problem, PnP somehow interprets it as the begining of the tag name. When changed to "==" it works. Any idea how to solve it?
Same problem here :-( I just removed the custom formatter from my XML