Replies: 2 comments 2 replies
-
I am running into this same error. What does your PNP code look like? |
Beta Was this translation helpful? Give feedback.
-
If you still want to use Add-PnPFieldFromXml, try with the internal field names rather than their display names. For example, Then, in your formula, also use the internal field names but without the square brackets, e.g. something like this: This did the trick for me. |
Beta Was this translation helpful? Give feedback.
-
Hello All,
Wondering if any one can shed some light ... I have a calculated column that uses the following formula:
=IF([Archive File]<>"Yes","Archive",(IF(AND([Archive File]="Yes",[Archive Processed]=FALSE),"Archiving in Progress","Archived")))
As you can see it references two additional (custom) columns (Archive File and Archive Processed). This formula works fine. I am now trying to use PnP to provision my columns and associated content types, and so I am using Add-PnPFieldFromXml to create my calculated column. Within my code the XML for the column is generated as follows:
=IF([Archive File]<>"Yes","Archive",(IF(AND([Archive File]="Yes",[Archive Processed]=FALSE),"Archiving in Progress","Archived")))
When I deploy the column using Add-PnPFieldFromXml the cmdlet executes without error and the column is created. However, when I look at the formula after creation it appears as follows:
Note how the referenced columns don't seem to resolve, yet they are clearly there (visible in the column selector list -- and they were created BEFORE I try to deploy my column that references them). If I modify my formula to use the out of the box Title instead, the deployment works fine. Any one know why I cant seem to reference custom columns via Add-PnPFieldFromXml or is there a special way they need to be referenced? I have tried using both the internal and the display names of the referenced columns and I get the same result either way.
Thanks in advance for any insights!
Beta Was this translation helpful? Give feedback.
All reactions