Rest API Uri:
https://gitbrent.github.io/SpRestLib/blog/2018/04/20/create-sharepoint-list-columns-using-rest.html
Create SharePoint List:
Accept:application/json;odata=verbose
Content-Type:application/json;odata=verbose
Body:
{
"__metadata": {"type": "SP.List"},
"AllowContentTypes": true,
"BaseTemplate": 100,
"Description": "Admin configuration list",
"Title": "AdminConfigList"
}
--------------------------------------------------------------------------------------
Multi line text field:
create a multiline text column:
Body:
{
'__metadata': {'type':'SP.Field', 'addToDefaultView': 'true' },
'FieldTypeKind': 3,
'Title': 'Blurb'
}
Headers:
Accept:application/json;odata=verbose
Content-Type:application/json;odata=verbose
add to view
Date&Time column:
BODY:
{
'__metadata': {'type':'SP.FieldDateTime', 'addToDefaultView': 'true' },
'FieldTypeKind': 4,
'Title': 'bylineDate',
'DisplayFormat': 0
}
--------------------------------------------
Yes/No type column
BODY:
{
'__metadata': {'type':'SP.Field', 'addToDefaultView': 'true' },
'FieldTypeKind': 8,
'Title': 'Deprecated'
}
--------------------------------------------
Hyperlink or Picture column
{
'__metadata': {'type':'SP.Field' },
'FieldTypeKind': 11,
'Title': 'Logo'
}
--------------------------------------------
Choice:
{ '__metadata':
{ 'type': 'SP.FieldChoice' },
'Title': 'PreferredSentNotification',
'FieldTypeKind': 6,
'Required': 'true',
'Choices': { 'results': ['email', 'Teams notification', 'Push notification' ] }
}
------------------------------------------
Comments
Post a Comment