Forum Discussion
After applying a list script I can't add a new item anymore - item form is empty
Hi all,
I created a list script (see below) and added it to a site design and then I apply the site design via flow.
All good, except for the item form. When I want to add a new item, the form only shows the title and attachment. I even can't change the form layout, because there are NO fields to check (see below). When I was looking into the site template history I see that the 'ContentType' 'Item' run into an error. No other information.
How do I have to change the list script so that all fields are available in the form again?
Many thanks for your help.
Missing form fields
Script error
--- List Script ----
{
"body": {
"$schema": "https://developer.microsoft.com/json-schemas/sp/site-design-script-actions.schema.json",
"actions": [
{
"verb": "createSPList",
"listName": "Timesheet",
"templateType": 100,
"color": "1",
"icon": "2",
"subactions": [
{
"verb": "setDescription",
"description": "Capture your time if required"
},
{
"verb": "addSPFieldXml",
"schemaXml": "<Field ID=\"{fa564e0f-0c70-4ab9-b863-0177e6ddd247}\" Type=\"Text\" Name=\"Title\" DisplayName=\"Title\" Required=\"FALSE\" SourceID=\"http://schemas.microsoft.com/sharepoint/v3\" StaticName=\"Title\" FromBaseType=\"TRUE\" ReadOnly=\"FALSE\" Hidden=\"FALSE\" MaxLength=\"255\" Customization=\"\" PITarget=\"\" PrimaryPITarget=\"\" PIAttribute=\"\" PrimaryPIAttribute=\"\" Aggregation=\"\" Node=\"\" />"
},
{
"verb": "addSPFieldXml",
"schemaXml": "<Field DisplayName=\"Date\" FriendlyDisplayFormat=\"Relative\" Format=\"DateTime\" IsModern=\"TRUE\" Name=\"Date\" Title=\"Date\" Type=\"DateTime\" ID=\"{ccd80605-9204-4cd9-a429-28910412e3d2}\" StaticName=\"Date\" Required=\"FALSE\" Hidden=\"FALSE\" Customization=\"\" ReadOnly=\"FALSE\" PITarget=\"\" PrimaryPITarget=\"\" PIAttribute=\"\" PrimaryPIAttribute=\"\" Aggregation=\"\" Node=\"\" />"
},
{
"verb": "addSPFieldXml",
"schemaXml": "<Field CommaSeparator=\"TRUE\" CustomUnitOnRight=\"TRUE\" DisplayName=\"Hours\" Format=\"Dropdown\" IsModern=\"TRUE\" Name=\"Hours\" Percentage=\"FALSE\" Title=\"Hours\" Type=\"Number\" Unit=\"None\" ID=\"{d431b2c9-197c-42d0-bfe0-55b539220167}\" StaticName=\"Hours\" Required=\"FALSE\" Hidden=\"FALSE\" Customization=\"\" ReadOnly=\"FALSE\" PITarget=\"\" PrimaryPITarget=\"\" PIAttribute=\"\" PrimaryPIAttribute=\"\" Aggregation=\"\" Node=\"\" />"
},
{
"verb": "addSPFieldXml",
"schemaXml": "<Field AppendOnly=\"FALSE\" DisplayName=\"Task description\" Format=\"Dropdown\" IsModern=\"TRUE\" IsolateStyles=\"FALSE\" Name=\"Taskdescription\" RichText=\"FALSE\" RichTextMode=\"Compatible\" Title=\"Task description\" Type=\"Note\" ID=\"{1a8438b8-86d5-41b6-a48f-d5972b6d55f5}\" StaticName=\"Taskdescription\" Required=\"FALSE\" Hidden=\"FALSE\" Customization=\"\" ReadOnly=\"FALSE\" PITarget=\"\" PrimaryPITarget=\"\" PIAttribute=\"\" PrimaryPIAttribute=\"\" Aggregation=\"\" Node=\"\" />"
},
{
"verb": "addSPFieldXml",
"schemaXml": "<Field CustomFormatter=\"{"elmType":"div","style":{"flex-wrap":"wrap","display":"flex"},"children":[{"elmType":"div","style":{"box-sizing":"border-box","padding":"4px 8px 5px 8px","overflow":"hidden","text-overflow":"ellipsis","display":"flex","border-radius":"16px","height":"24px","align-items":"center","white-space":"nowrap","margin":"4px 4px 4px 4px"},"attributes":{"class":{"operator":":","operands":[{"operator":"==","operands":["@currentField","New"]},"sp-css-backgroundColor-BgCornflowerBlue sp-field-fontSizeSmall sp-css-color-CornflowerBlueFont",{"operator":":","operands":[{"operator":"==","operands":["@currentField","Updated"]},"sp-css-backgroundColor-BgMintGreen sp-field-fontSizeSmall sp-css-color-MintGreenFont",{"operator":":","operands":[{"operator":"==","operands":["@currentField","Processed"]},"sp-css-backgroundColor-BgGold sp-field-fontSizeSmall sp-css-color-GoldFont",{"operator":":","operands":[{"operator":"==","operands":["@currentField",""]},"","sp-field-borderAllRegular sp-field-borderAllSolid sp-css-borderColor-neutralSecondary"]}]}]}]}},"txtContent":"@currentField"}],"templateId":"BgColorChoicePill"}\" DisplayName=\"Status\" FillInChoice=\"FALSE\" Format=\"Dropdown\" IsModern=\"TRUE\" Name=\"Status\" Title=\"Status\" Type=\"Choice\" ID=\"{280cfd4c-1de0-4ffa-8186-943e8352afb3}\" StaticName=\"Status\" Required=\"FALSE\" Hidden=\"FALSE\" Customization=\"\" ReadOnly=\"FALSE\" PITarget=\"\" PrimaryPITarget=\"\" PIAttribute=\"\" PrimaryPIAttribute=\"\" Aggregation=\"\" Node=\"\"><CHOICES><CHOICE>New</CHOICE><CHOICE>Updated</CHOICE><CHOICE>Processed</CHOICE></CHOICES><Default>New</Default><ClientValidationFormula>=if([$Status]=='Processed','true','false')</ClientValidationFormula></Field>"
},
{
"verb": "addSPFieldXml",
"schemaXml": "<Field Type=\"TaxonomyFieldType\" DisplayName=\"Task type\" ShowField=\"Term1033\" ID=\"{a3c265d6-9450-457a-92a7-4411d56f41b8}\" StaticName=\"Task_x0020_type_x0020_2\" Name=\"Task_x0020_type_x0020_2\" CustomFormatter=\"\" Description=\"What skill set did you use?\" EnforceUniqueValues=\"FALSE\" Required=\"TRUE\" Hidden=\"FALSE\" Customization=\"\" ReadOnly=\"FALSE\" PITarget=\"\" PrimaryPITarget=\"\" PIAttribute=\"\" PrimaryPIAttribute=\"\" Aggregation=\"\" Node=\"\"><Default /><Customization><ArrayOfProperty><Property><Name>SspId</Name><Value xmlns:q1=\"http://www.w3.org/2001/XMLSchema\" p4:type=\"q1:string\" xmlns:p4=\"http://www.w3.org/2001/XMLSchema-instance\">8dd3a02a-2d0e-4da3-8964-69b0fec87fb5</Value></Property><Property><Name>GroupId</Name></Property><Property><Name>TermSetId</Name><Value xmlns:q2=\"http://www.w3.org/2001/XMLSchema\" p4:type=\"q2:string\" xmlns:p4=\"http://www.w3.org/2001/XMLSchema-instance\">f3d8e2f1-f345-47a7-9956-9c40b64da36f</Value></Property><Property><Name>AnchorId</Name><Value xmlns:q3=\"http://www.w3.org/2001/XMLSchema\" p4:type=\"q3:string\" xmlns:p4=\"http://www.w3.org/2001/XMLSchema-instance\">00000000-0000-0000-0000-000000000000</Value></Property><Property><Name>UserCreated</Name><Value xmlns:q4=\"http://www.w3.org/2001/XMLSchema\" p4:type=\"q4:boolean\" xmlns:p4=\"http://www.w3.org/2001/XMLSchema-instance\">false</Value></Property><Property><Name>Open</Name><Value xmlns:q5=\"http://www.w3.org/2001/XMLSchema\" p4:type=\"q5:boolean\" xmlns:p4=\"http://www.w3.org/2001/XMLSchema-instance\">false</Value></Property><Property><Name>IsPathRendered</Name><Value xmlns:q7=\"http://www.w3.org/2001/XMLSchema\" p4:type=\"q7:boolean\" xmlns:p4=\"http://www.w3.org/2001/XMLSchema-instance\">false</Value></Property><Property><Name>IsKeyword</Name><Value xmlns:q8=\"http://www.w3.org/2001/XMLSchema\" p4:type=\"q8:boolean\" xmlns:p4=\"http://www.w3.org/2001/XMLSchema-instance\">false</Value></Property><Property><Name>TargetTemplate</Name></Property><Property><Name>CreateValuesInEditForm</Name><Value xmlns:q9=\"http://www.w3.org/2001/XMLSchema\" p4:type=\"q9:boolean\" xmlns:p4=\"http://www.w3.org/2001/XMLSchema-instance\">false</Value></Property><Property><Name>IsDocTagsEnabled</Name></Property><Property><Name>FilterAssemblyStrongName</Name><Value xmlns:q10=\"http://www.w3.org/2001/XMLSchema\" p4:type=\"q10:string\" xmlns:p4=\"http://www.w3.org/2001/XMLSchema-instance\">Microsoft.SharePoint.Taxonomy, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c</Value></Property><Property><Name>FilterClassName</Name><Value xmlns:q11=\"http://www.w3.org/2001/XMLSchema\" p4:type=\"q11:string\" xmlns:p4=\"http://www.w3.org/2001/XMLSchema-instance\">Microsoft.SharePoint.Taxonomy.TaxonomyField</Value></Property><Property><Name>FilterMethodName</Name><Value xmlns:q12=\"http://www.w3.org/2001/XMLSchema\" p4:type=\"q12:string\" xmlns:p4=\"http://www.w3.org/2001/XMLSchema-instance\">GetFilteringHtml</Value></Property><Property><Name>FilterJavascriptProperty</Name><Value xmlns:q13=\"http://www.w3.org/2001/XMLSchema\" p4:type=\"q13:string\" xmlns:p4=\"http://www.w3.org/2001/XMLSchema-instance\">FilteringJavascript</Value></Property></ArrayOfProperty></Customization></Field>"
},
{
"verb": "addSPFieldXml",
"schemaXml": "<Field Type=\"TaxonomyFieldType\" DisplayName=\"Studio\" ShowField=\"Term1033\" ID=\"{e7f378f8-dd2e-420b-9c81-c60132acedd0}\" StaticName=\"Studio\" Name=\"Studio\" CustomFormatter=\"\" EnforceUniqueValues=\"FALSE\" Required=\"FALSE\"><Default>1;#Julia Welburn|ae9106de-8b9b-4238-81a4-c6d74277e503</Default><Customization><ArrayOfProperty><Property><Name>SspId</Name><Value xmlns:q1=\"http://www.w3.org/2001/XMLSchema\" p4:type=\"q1:string\" xmlns:p4=\"http://www.w3.org/2001/XMLSchema-instance\">8dd3a02a-2d0e-4da3-8964-69b0fec87fb5</Value></Property><Property><Name>GroupId</Name></Property><Property><Name>TermSetId</Name><Value xmlns:q2=\"http://www.w3.org/2001/XMLSchema\" p4:type=\"q2:string\" xmlns:p4=\"http://www.w3.org/2001/XMLSchema-instance\">da8d3268-9613-438d-b5d6-503020a924c8</Value></Property><Property><Name>AnchorId</Name><Value xmlns:q3=\"http://www.w3.org/2001/XMLSchema\" p4:type=\"q3:string\" xmlns:p4=\"http://www.w3.org/2001/XMLSchema-instance\">00000000-0000-0000-0000-000000000000</Value></Property><Property><Name>UserCreated</Name><Value xmlns:q4=\"http://www.w3.org/2001/XMLSchema\" p4:type=\"q4:boolean\" xmlns:p4=\"http://www.w3.org/2001/XMLSchema-instance\">false</Value></Property><Property><Name>Open</Name><Value xmlns:q5=\"http://www.w3.org/2001/XMLSchema\" p4:type=\"q5:boolean\" xmlns:p4=\"http://www.w3.org/2001/XMLSchema-instance\">false</Value></Property><Property><Name>IsPathRendered</Name><Value xmlns:q7=\"http://www.w3.org/2001/XMLSchema\" p4:type=\"q7:boolean\" xmlns:p4=\"http://www.w3.org/2001/XMLSchema-instance\">false</Value></Property><Property><Name>IsKeyword</Name><Value xmlns:q8=\"http://www.w3.org/2001/XMLSchema\" p4:type=\"q8:boolean\" xmlns:p4=\"http://www.w3.org/2001/XMLSchema-instance\">false</Value></Property><Property><Name>TargetTemplate</Name></Property><Property><Name>CreateValuesInEditForm</Name><Value xmlns:q9=\"http://www.w3.org/2001/XMLSchema\" p4:type=\"q9:boolean\" xmlns:p4=\"http://www.w3.org/2001/XMLSchema-instance\">false</Value></Property><Property><Name>IsDocTagsEnabled</Name></Property><Property><Name>FilterAssemblyStrongName</Name><Value xmlns:q10=\"http://www.w3.org/2001/XMLSchema\" p4:type=\"q10:string\" xmlns:p4=\"http://www.w3.org/2001/XMLSchema-instance\">Microsoft.SharePoint.Taxonomy, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c</Value></Property><Property><Name>FilterClassName</Name><Value xmlns:q11=\"http://www.w3.org/2001/XMLSchema\" p4:type=\"q11:string\" xmlns:p4=\"http://www.w3.org/2001/XMLSchema-instance\">Microsoft.SharePoint.Taxonomy.TaxonomyField</Value></Property><Property><Name>FilterMethodName</Name><Value xmlns:q12=\"http://www.w3.org/2001/XMLSchema\" p4:type=\"q12:string\" xmlns:p4=\"http://www.w3.org/2001/XMLSchema-instance\">GetFilteringHtml</Value></Property><Property><Name>FilterJavascriptProperty</Name><Value xmlns:q13=\"http://www.w3.org/2001/XMLSchema\" p4:type=\"q13:string\" xmlns:p4=\"http://www.w3.org/2001/XMLSchema-instance\">FilteringJavascript</Value></Property></ArrayOfProperty></Customization></Field>"
},
{
"verb": "addSPFieldXml",
"schemaXml": "<Field ID=\"{82642ec8-ef9b-478f-acf9-31f7d45fbc31}\" ReadOnly=\"TRUE\" Type=\"Computed\" Name=\"LinkTitle\" DisplayName=\"Job name\" DisplayNameSrcField=\"Title\" ClassInfo=\"Menu\" AuthoringInfo=\"(linked to item with edit menu)\" ListItemMenuAllowed=\"Required\" LinkToItemAllowed=\"Prohibited\" SourceID=\"http://schemas.microsoft.com/sharepoint/v3\" StaticName=\"LinkTitle\" FromBaseType=\"TRUE\"><FieldRefs><FieldRef Name=\"Title\" /><FieldRef Name=\"LinkTitleNoMenu\" /><FieldRef Name=\"_EditMenuTableStart2\" /><FieldRef Name=\"_EditMenuTableEnd\" /></FieldRefs><DisplayPattern><FieldSwitch><Expr><GetVar Name=\"FreeForm\" /></Expr><Case Value=\"TRUE\"><Field Name=\"LinkTitleNoMenu\" /></Case><Default><HTML><![CDATA[<div class=\"ms-vb itx\" onmouseover=\"OnItem(this)\" CTXName=\"ctx]]></HTML><Field Name=\"_EditMenuTableStart2\" /><HTML><![CDATA[\">]]></HTML><Field Name=\"LinkTitleNoMenu\" /><HTML><![CDATA[</div>]]></HTML><HTML><![CDATA[<div class=\"s4-ctx\" onmouseover=\"OnChildItem(this.parentNode); return false;\">]]></HTML><HTML><![CDATA[<span> </span>]]></HTML><HTML><![CDATA[<a onfocus=\"OnChildItem(this.parentNode.parentNode); return false;\" onclick=\"PopMenuFromChevron(event); return false;\" href=\"javascript:;\" title=\"Open Menu\"></a>]]></HTML><HTML><![CDATA[<span> </span>]]></HTML><HTML><![CDATA[</div>]]></HTML></Default></FieldSwitch></DisplayPattern></Field>"
},
{
"verb": "addSPFieldXml",
"schemaXml": "<Field Type=\"Note\" DisplayName=\"Task type 2_0\" StaticName=\"a3c265d69450457a92a74411d56f41b8\" Name=\"a3c265d69450457a92a74411d56f41b8\" ID=\"{d8455d2b-abd4-4f7b-9a0e-0d309e9a3aa8}\" ShowInViewForms=\"FALSE\" Required=\"FALSE\" Hidden=\"TRUE\" CanToggleHidden=\"TRUE\" />"
},
{
"verb": "addSPLookupFieldXml",
"schemaXml": "<Field Type=\"LookupMulti\" DisplayName=\"Taxonomy Catch All Column\" StaticName=\"TaxCatchAll\" Name=\"TaxCatchAll\" ID=\"{f3b0adf9-c1a2-4b02-920d-943fba4b3611}\" ShowInViewForms=\"FALSE\" Required=\"FALSE\" Hidden=\"TRUE\" CanToggleHidden=\"TRUE\" ShowField=\"CatchAllData\" Mult=\"TRUE\" Sortable=\"FALSE\" AllowDeletion=\"TRUE\" Sealed=\"TRUE\" />",
"targetListName": "TaxonomyHiddenList"
},
{
"verb": "addSPFieldXml",
"schemaXml": "<Field Type=\"Note\" DisplayName=\"Studio_0\" StaticName=\"e7f378f8dd2e420b9c81c60132acedd0\" Name=\"e7f378f8dd2e420b9c81c60132acedd0\" ID=\"{4502c65c-2404-4ab1-b76b-6319de6c3935}\" ShowInViewForms=\"FALSE\" Required=\"FALSE\" Hidden=\"TRUE\" CanToggleHidden=\"TRUE\" />"
},
{
"verb": "addContentType",
"name": "Item",
"id": "0x01",
"fieldRefsXml": [
"<FieldRef ID=\"{fa564e0f-0c70-4ab9-b863-0177e6ddd247}\" Name=\"Title\" Required=\"FALSE\" Hidden=\"FALSE\" ReadOnly=\"FALSE\" PITarget=\"\" PrimaryPITarget=\"\" PIAttribute=\"\" PrimaryPIAttribute=\"\" Aggregation=\"\" Node=\"\" />",
"<FieldRef ID=\"{1a8438b8-86d5-41b6-a48f-d5972b6d55f5}\" Name=\"Taskdescription\" Required=\"FALSE\" Hidden=\"FALSE\" ReadOnly=\"FALSE\" PITarget=\"\" PrimaryPITarget=\"\" PIAttribute=\"\" PrimaryPIAttribute=\"\" Aggregation=\"\" Node=\"\" />",
"<FieldRef ID=\"{ccd80605-9204-4cd9-a429-28910412e3d2}\" Name=\"Date\" Required=\"FALSE\" Hidden=\"FALSE\" ReadOnly=\"FALSE\" PITarget=\"\" PrimaryPITarget=\"\" PIAttribute=\"\" PrimaryPIAttribute=\"\" Aggregation=\"\" Node=\"\" />",
"<FieldRef ID=\"{d431b2c9-197c-42d0-bfe0-55b539220167}\" Name=\"Hours\" Required=\"FALSE\" Hidden=\"FALSE\" ReadOnly=\"FALSE\" PITarget=\"\" PrimaryPITarget=\"\" PIAttribute=\"\" PrimaryPIAttribute=\"\" Aggregation=\"\" Node=\"\" />",
"<FieldRef ID=\"{a3c265d6-9450-457a-92a7-4411d56f41b8}\" Name=\"Task_x0020_type_x0020_2\" DisplayName=\"Task type\" Required=\"TRUE\" Hidden=\"FALSE\" ReadOnly=\"FALSE\" PITarget=\"\" PrimaryPITarget=\"\" PIAttribute=\"\" PrimaryPIAttribute=\"\" Aggregation=\"\" Node=\"\" />",
"<FieldRef ID=\"{280cfd4c-1de0-4ffa-8186-943e8352afb3}\" Name=\"Status\" DisplayName=\"Status\" Required=\"FALSE\" Hidden=\"FALSE\" ReadOnly=\"FALSE\" PITarget=\"\" PrimaryPITarget=\"\" PIAttribute=\"\" PrimaryPIAttribute=\"\" Aggregation=\"\" Node=\"\" Format=\"Dropdown\" />",
"<FieldRef ID=\"{82642ec8-ef9b-478f-acf9-31f7d45fbc31}\" Name=\"LinkTitle\" DisplayName=\"Job name\" Required=\"FALSE\" Hidden=\"TRUE\" ReadOnly=\"TRUE\" PITarget=\"\" PrimaryPITarget=\"\" PIAttribute=\"\" PrimaryPIAttribute=\"\" Aggregation=\"\" Node=\"\" />",
"<FieldRef ID=\"{d8455d2b-abd4-4f7b-9a0e-0d309e9a3aa8}\" Name=\"a3c265d69450457a92a74411d56f41b8\" Required=\"FALSE\" Hidden=\"TRUE\" ReadOnly=\"FALSE\" PITarget=\"\" PrimaryPITarget=\"\" PIAttribute=\"\" PrimaryPIAttribute=\"\" Aggregation=\"\" Node=\"\" />",
"<FieldRef ID=\"{f3b0adf9-c1a2-4b02-920d-943fba4b3611}\" Name=\"TaxCatchAll\" Required=\"FALSE\" Hidden=\"TRUE\" ReadOnly=\"FALSE\" PITarget=\"\" PrimaryPITarget=\"\" PIAttribute=\"\" PrimaryPIAttribute=\"\" Aggregation=\"\" Node=\"\" />",
"<FieldRef ID=\"{e7f378f8-dd2e-420b-9c81-c60132acedd0}\" Name=\"Studio\" DisplayName=\"Studio\" Required=\"FALSE\" Hidden=\"TRUE\" ReadOnly=\"FALSE\" PITarget=\"\" PrimaryPITarget=\"\" PIAttribute=\"\" PrimaryPIAttribute=\"\" Aggregation=\"\" Node=\"\" />",
"<FieldRef ID=\"{4502c65c-2404-4ab1-b76b-6319de6c3935}\" Name=\"e7f378f8dd2e420b9c81c60132acedd0\" Required=\"FALSE\" Hidden=\"TRUE\" ReadOnly=\"FALSE\" PITarget=\"\" PrimaryPITarget=\"\" PIAttribute=\"\" PrimaryPIAttribute=\"\" Aggregation=\"\" Node=\"\" />"
]
},
{
"verb": "addContentType",
"name": "Folder",
"id": "0x0120"
},
{
"verb": "addSPView",
"name": "All Items",
"viewFields": [
"LinkTitle",
"Taskdescription",
"Date",
"Hours",
"Task_x0020_type_x0020_2",
"Status"
],
"query": "",
"rowLimit": 30,
"isPaged": true,
"makeDefault": true,
"formatterJSON": "{\"$schema\":\"https://developer.microsoft.com/json-schemas/sp/v2/row-formatting.schema.json\",\"commandBarProps\":{\"commands\":[{\"key\":\"new\",\"text\":\"Add time\"},{\"key\":\"editInGridView\",\"text\":\"Quick edit\"},{\"key\":\"share\",\"hide\":true},{\"key\":\"automate\",\"hide\":true},{\"key\":\"integrate\",\"hide\":true},{\"key\":\"export\",\"hide\":true},{\"key\":\"alertMe\",\"hide\":true},{\"key\":\"manageAlert\",\"hide\":true},{\"key\":\"copyLink\",\"hide\":true}]}}",
"replaceViewFields": true
},
{
"verb": "addSPView",
"name": "Admin",
"viewFields": [
"LinkTitle",
"Taskdescription",
"Date",
"Hours",
"Task_x0020_type_x0020_2",
"Status"
],
"query": "",
"rowLimit": 30,
"isPaged": true,
"replaceViewFields": true
}
]
}
]
}
}