SharePoint OData Connector 23.2

# Insert a List

To insert a list, the `insertXml` must include the following properties.

`TYPE` | The type of item to insert. To insert a list, specify `LIST`.
`TITLE` | The title of the list.

You must then specify either (`SITEID` and `SITECOLLECTIONURL`) or (`INSERTFROMPATH` and `SITEURL`).

`INSERTFROMPATH` | To insert a list by path, set this property to `TRUE`.
`SITECOLLECTIONURL` | The absolute URL of the site collection to which you want to add the list.
`SITEID` | The GUID of the site to which you want to add the list.
`SITEURL` | The absolute URL of the site to which you want to add the list.

The following properties are optional:

`BASETEMPLATE` | The list template type, for example "GenericList" or "DocumentLibrary". For a list of acceptable types, refer to http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.client.listtemplatetype
`DESCRIPTION` | A description for the list.
`ENABLEVERSIONING` | To enable versioning for the list, set this parameter to `TRUE`.
`ENABLEATTACHMENTS` | To allow attachments in the list, set this parameter to `TRUE`.

You can optionally add metadata to the list. In the following field names, replace `[Prefix]` with the value of the `ItemFieldNamePrefix` parameter, as set in the configuration file.

`[Prefix]FIELDNAME` | The name of a column that you want to create.
`[Prefix][FieldName]_Title` | The title of the column.
`[Prefix][FieldName]_FieldTypeKind` | The type of the column. For a list of acceptable types, refer to http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.client.fieldtype.ASPX
`[Prefix][FieldName]_Description` | A description of the column.
`[Prefix][FieldName]_Required` | A Boolean that specifies whether the column requires a value.

For example, the value of your `insertXML` action parameter might look like this:

    <insertXML>
      <insert>
        <reference>TEST_LIST</reference>
        <property name="TYPE" value="LIST"/>
        <property name="TITLE" value="My New List"/>
        <property name="SITEID" value="E11526FFA45AF1F1"/>
        <property name="SITECOLLECTIONURL" value="http://sharepoint/SiteCollection/"/>
        <metadata name="MyPrefixFIELDNAME" value="Field1"/>
        <metadata name="MyPrefixField1_Title" value="MyField"/>
        <metadata name="MyPrefixField1_FieldTypeKind" value="Integer"/>
        <metadata name="MyPrefixField1_Description" value="My Field"/>
        <metadata name="MyPrefixField1_Required" value="True"/>
      </insert>
    </insertXML>

To insert a list by path, your XML might look like this:

    <insertXML>
      <insert>
        <reference>TEST_LIST</reference>
        <property name="TYPE" value="LIST"/>
        <property name="TITLE" value="My New List"/>
        <property name="SITEURL" value="http://sharepoint/SiteCollection/Site/"/>
        <property name="INSERTFROMPATH" value="TRUE"/>
      </insert>
    </insertXML>

Copyright 2023 Open Text
Version 23.2 | Last updated March 2023

Send documentation feedback

Close

Send documentation feedback

To send feedback using your default email client, open an email window.

Otherwise, send your feedback and the information below to swpdl.idoldocsfeedback@microfocus.com.

We appreciate your feedback!

Product: IDOL SharePoint OData Connector 23.2

Topic Title: Insert a List