Skip to content

Issues running provided code sample #8698

@Rykimaruh

Description

@Rykimaruh

I'm trying to follow the steps in this article and I get an error message midway through.

I'm using the provided script from the article

$site_script = '
 {
     "$schema": "https://developer.microsoft.com/json-schemas/sp/site-design-script-actions.schema.json",
         "actions": [
             {
                 "verb": "createSPList",
                 "listName": "Customer Tracking",
                 "templateType": 100,
                 "subactions": [
                     {
                         "verb": "setDescription",
                         "description": "List of Customers and Orders"
                     },
                     {
                         "verb": "addSPField",
                         "fieldType": "Text",
                         "displayName": "Customer Name",
                         "isRequired": false,
                         "addToDefaultView": true
                     },
                     {
                         "verb": "addSPField",
                         "fieldType": "Number",
                         "displayName": "Requisition Total",
                         "addToDefaultView": true,
                         "isRequired": true
                     },
                     {
                         "verb": "addSPField",
                         "fieldType": "User",
                         "displayName": "Contact",
                         "addToDefaultView": true,
                         "isRequired": true
                     },
                     {
                         "verb": "addSPField",
                         "fieldType": "Note",
                         "displayName": "Meeting Notes",
                         "isRequired": false
                     }
                 ]
             }
         ]
 }
 '

Something wrong with the provided script when I run it:

Add-SPOSiteScript
 -Title "Create customer tracking list"
 -Content $site_script
 -Description "Creates list for tracking customer contact information"

I get the following error in Powershell:
Add-SPOSiteScript : Unexpected character encountered while parsing value: $. Path '', line 0, position 0.


Document Details

Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:docsCategory: SharePoint developer/development documentation relatedarea:site-designCategory: Site Designs/Site Scriptstype:archive-old-issueIssues which are closed as tool old for active work

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions