May 07 2019 12:39 PM
I am developing a site script to create some site columns and content types. Mostly it is working OK, but I'm having trouble figuring out how to use the createSiteColumnXml verb to create a hyperlink/picture field. First I tried this:
That didn't work. After some additional research I thought maybe I needed to include a value for ID, so I generated a GUID and changed it to:
May 07 2019 03:30 PM
@Gary_Stewart I don't believe you can create that type of column in site scripts at the moment. This is a good tool to see what is available at the moment https://www.sitedesigner.io
May 08 2019 05:56 AM
@Tanya Denton thanks. That is a pretty handy tool.
May 08 2019 06:39 AM
@Gary_Stewart I would suggest creating the the picture field on a list and using PowerShell command "Get-SPOSiteScriptFromList" to extract out the values you need.
"schemaXml": "<Field DisplayName=\"TestPicture\" Format=\"Image\" Name=\"TestPicture\ " Title=\"TestPicture\" Type=\"URL\" ID=\"{6f2db82c-f1a6-415d-9678-324b1d809f17}\" StaticName=\ "TestPicture\" />"
Jul 09 2019 02:07 AM
@Gary_Stewart I got this working for URL fields:
{
"verb": "addSPFieldXml",
"schemaXml":"<Field Type=\"URL\" DisplayName=\"Website\" Required=\"FALSE\" Format=\"Hyperlink\" StaticName=\"Website\" Name=\"Website\"></Field>",
"addToDefaultView": true
},