Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ERROR] The formula contains a syntax error or is not supported. #46

Open
daronp23 opened this issue Feb 16, 2023 · 1 comment
Open

Comments

@daronp23
Copy link

Didn't see this issue posted so thought I'd share my experience and workaround. I encountered this error attempting to migrate a list containing calculated list columns:

[Error] The formula contains a syntax error or is not supported.
Apply-PnPProvisioningTemplate : The formula contains a syntax error or is not supported.
At C:\.....\Move-Lists.ps1:124 char:9
+         Apply-PnPProvisioningTemplate -Path Lists.xml
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : WriteError: (:) [Apply-PnPProvisioningTemplate], ServerException
    + FullyQualifiedErrorId : EXCEPTION,PnP.PowerShell.Commands.Provisioning.Site.ApplyProvisioningTemplate

Since it choked in the middle of list provisioning, I looked at the migrated list and saw only a portion of the expected fields were provisioned just shy of where the first calculated field should have been created. I looked at the Calculated field types with Formulas in the Lists.xml and noted that fields were being referenced as such : [{fieldtitle:InternalName}]

Did some digging and found similar issues reported with Apply-PnPProvisioningTemplate such as this post suggesting that a difference between how the field is defined vs what PnP provisioning expects and suggested changing [{fieldtitle:InternalName}] to just [DisplayName] as workaround.

As such I reran the migration, this time using the Prepare-Deployment-Package-For-Client script vs RunAllScripts so I can edit the Lists.xml before continuing on. Made the changes in the package and continued with running Convert-packages.bat and it successfully completed. Confirmed the target list looked good then finished off by importing my power apps form.

@Zerg00s
Copy link
Owner

Zerg00s commented May 2, 2023

Thank you for sharing your solution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants