PnP-Sites-Core icon indicating copy to clipboard operation
PnP-Sites-Core copied to clipboard

Apply PnPTemplate fails when a view contains a customFormatter

Open Safouenebha opened this issue 5 years ago • 6 comments

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

Safouenebha avatar Feb 13 '20 15:02 Safouenebha

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

ghost avatar Feb 13 '20 15:02 ghost

Any Update on this Bug?

schneika avatar Jun 19 '20 12:06 schneika

I will appreciate an update on this issue! I am also having exact same issue!

nilang-shah avatar Jul 15 '20 04:07 nilang-shah

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", "" ] } } ]]>

lordneeko avatar Aug 25 '20 16:08 lordneeko

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?

novaktom avatar Sep 17 '20 06:09 novaktom

Same problem here :-( I just removed the custom formatter from my XML

HamEv avatar Sep 24 '20 10:09 HamEv