Site Design Create Content Type action gives an invalid type error
Category
- [ ] Question
- [ ] Typo
- [x ] Bug
- [ ] Additional article idea
Expected or Desired Behavior
When using the createContentType action in a site design I expect the content type to be created in the site that has been created from a site design which contains that site script.
Observed Behavior
When using a createContentType action from the Site Design json schema, I get: One or more of the properties on this action has an invalid type.
Steps to Reproduce
Put a script with the createContentType action in variable in PowerShell, I used the example of the Site Design document:
{
"verb": "createSiteColumn",
"fieldType": "Text",
"internalName": "To",
"displayName": "To",
"isRequired": false
},
{
"verb": "createSiteColumn",
"fieldType": "Text",
"internalName": "From",
"displayName": "From",
"isRequired": false
},
{
"verb": "createSiteColumn",
"fieldType": "Text",
"internalName": "CC",
"displayName": "CC",
"isRequired": false
},
{
"verb": "createSiteColumn",
"fieldType": "Text",
"internalName": "BCC",
"displayName": "BCC",
"isRequired": false
},
{
"verb": "createSiteColumn",
"fieldType": "DateTime",
"internalName": "SentOn",
"displayName": "Sent On",
"isRequired": false
},
{
"verb": "createSiteColumn",
"fieldType": "DateTime",
"internalName": "ReceivedTime",
"displayName": "Received Time",
"isRequired": false
},
{
"verb": "createSiteColumn",
"fieldType": "Text",
"internalName": "Importance",
"displayName": "Importance",
"isRequired": false
},
{
"verb": "createSiteColumn",
"fieldType": "Text",
"internalName": "AttachCount",
"displayName": "Attach Count",
"isRequired": false
},
{
"verb": "createSiteColumn",
"fieldType": "Text",
"internalName": "Sensivity",
"displayName": "Sensitivity",
"isRequired": false
},
{
"verb": "createSiteColumn",
"fieldType": "Text",
"internalName": "MessageID",
"displayName": "Message ID",
"isRequired": false
},
{
"verb": "createContentType",
"name": "Email",
"description": "Project Email",
"parentName": "Item",
"hidden": false,
"subactions": [{
"verb": "addSiteColumn",
"internalName": "To"
},
{
"verb": "addSiteColumn",
"internalName": "From"
},
{
"verb": "addSiteColumn",
"internalName": "CC"
},
{
"verb": "addSiteColumn",
"internalName": "BCC"
},
{
"verb": "addSiteColumn",
"internalName": "SentOn"
},
{
"verb": "addSiteColumn",
"internalName": "ReceivedTime"
},
{
"verb": "addSiteColumn",
"internalName": "Importance"
},
{
"verb": "addSiteColumn",
"internalName": "AttachCount"
},
{
"verb": "addSiteColumn",
"internalName": "Sensitivity"
},
{
"verb": "addSiteColumn",
"internalName": "MessageID"
}
]
}
Submission Guidelines
Using the powershell scripts - Add-spositedesign etc
Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.
There appears to be a discrepancy between the script you posted and the script that running on your site design.
Notice the internal names of the columns in your site script. Now, look at the sub actions in the image you posted. The screen shot shows "Add site column HLTo to content type". This means it's looking for an internal field names that start with HLTo... but in your createSiteColumn, the internal name is "To". The site script you posted is valid, but it's not the one that is being executed in your site design.
The error is not super helpful, but it's the error that shows up when trying to add a site column that doesn't exist.
To verify, call Get-SPOSiteScript and compare that site script to the one you posted.
If it is different, set the site script again with your new script json posted using Set-SPOSiteScript
Hi Beau,
thanks for your response, my mistake. I have gone through and updated the site script so that all of the internal names are now matching.
Unfortunately i am still receiving the same error...

Script is
{
"verb": "createSiteColumn",
"fieldType": "Text",
"internalName": "To",
"displayName": "To",
"isRequired": false
},
{
"verb": "createSiteColumn",
"fieldType": "Text",
"internalName": "From",
"displayName": "From",
"isRequired": false
},
{
"verb": "createSiteColumn",
"fieldType": "Text",
"internalName": "CC",
"displayName": "CC",
"isRequired": false
},
{
"verb": "createSiteColumn",
"fieldType": "Text",
"internalName": "BCC",
"displayName": "BCC",
"isRequired": false
},
{
"verb": "createSiteColumn",
"fieldType": "DateTime",
"internalName": "SentOn",
"displayName": "Sent On",
"isRequired": false
},
{
"verb": "createSiteColumn",
"fieldType": "DateTime",
"internalName": "ReceivedTime",
"displayName": "Received Time",
"isRequired": false
},
{
"verb": "createSiteColumn",
"fieldType": "Text",
"internalName": "Importance",
"displayName": "Importance",
"isRequired": false
},
{
"verb": "createSiteColumn",
"fieldType": "Text",
"internalName": "AttachCount",
"displayName": "Attach Count",
"isRequired": false
},
{
"verb": "createSiteColumn",
"fieldType": "Text",
"internalName": "HLSensivity",
"displayName": "Sensitivity",
"isRequired": false
},
{
"verb": "createSiteColumn",
"fieldType": "Text",
"internalName": "MessageID",
"displayName": "Message ID",
"isRequired": false
},
{
"verb": "createContentType",
"name": "Email",
"description": "HL Project Email",
"parentName": "Item",
"hidden": false,
"subactions": [{
"verb": "addSiteColumn",
"internalName": "To"
},
{
"verb": "addSiteColumn",
"internalName": "From"
},
{
"verb": "addSiteColumn",
"internalName": "CC"
},
{
"verb": "addSiteColumn",
"internalName": "BCC"
},
{
"verb": "addSiteColumn",
"internalName": "SentOn"
},
{
"verb": "addSiteColumn",
"internalName": "ReceivedTime"
},
{
"verb": "addSiteColumn",
"internalName": "Importance"
},
{
"verb": "addSiteColumn",
"internalName": "AttachCount"
},
{
"verb": "addSiteColumn",
"internalName": "Sensitivity"
},
{
"verb": "addSiteColumn",
"internalName": "MessageID"
}
]
},
Thanks again.
I would double check, it looks like you missed HLSensitivity.
🤦
bad spelling, many apologies and thanks :)
Josh
Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues