# Microsoft SharePoint

The PMG SharePoint Connector provides management and interactivity transactions with Microsoft SharePoint. The connector supports connectivity to SharePoint online and SharePoint on premise. By defining scenarios as needed for each target environment, the SharePoint actions can then be used to perform various activities.

# SharePoint Scenarios

To define scenarios for SharePoint, begin by accessing the Scenario management screen either from Administration, Connectors, SharePoint, or from Workflow Designer, Manage, Connector Configuration, SharePoint.

SharePoint Scenario

Additional attributes for a scenario may be added with the "Add Attribute" button at the bottom right of the screen.

SharePoint Additional Attributes

From the initial screen shown, define a new scenario by name and the settings management for the scenario will display as above. Provide values for each of the inputs to establish a connection to the respective scenario. Once defined, this scenario name may be used by the SharePoint actions.

# SharePoint Workflow Actions

# Get File

SharePoint action icon

Action Function:

The Get File action will retrieve a file from SharePoint.

Action Properties:

Scenario: The connection scenario to use for the action

Site Name: The path to the related site, e.g.

/sites/mysite

**List Name: ** The name of the list containing the file

**Relative Folder URL: **The relative URL of the file to be retrieved, e.g.

/sites/mysite/Shared Documents/TestFolder

CAML Query: The CAML query to retrieve the document. An example is below.

<View>
    <Query>
        <Where>
                <Eq>
                    <FieldRef Name="LinkFilename" />
                    <Value Type='Text'>generic-table.png</Value>
                </Eq>
        </Where>
    </Query>

<OrderBy>
    <FieldRef Name="FileLeafRef" Ascending="True"></FieldRef>
</OrderBy>
</View>

**File Variable for Result: ** the target file variable to store the retrieved document

Variable for Error Messages: An optional variable to store any error messages from the transaction

# Get File Versions

SharePoint action icon

Action Function:

The Get File Versions action will retrieve versions for a given file.

Action Properties:

Scenario: The connection scenario to use for the action

Site Name: The path to the related site, e.g.

/sites/mysite

**List Name: ** The name of the list containing the file

**Relative Folder URL: **The relative URL of the file to be retrieved, e.g.

/sites/mysite/Shared Documents/TestFolder

File Name: The name of the file to retrieve versions

String Variable for List Data: a target string or object variable to store the retrieved versions data.

An example document is below.

<ListItemCollection>
  <ListItem>
    <CheckInComment></CheckInComment>
    <Created>3/18/2020 2:07:29 PM</Created>
    <CreatedBy>balexander@pmg.net</CreatedBy>
    <ID>512</ID>
    <IsCurrentVersion>False</IsCurrentVersion>
    <Length>47243</Length>
    <Url>_vti_history/512/Shared Documents/Policies and Procedures/Source Documents/PMG Asset Disposal Policy.docx</Url>
    <VersionLabel>1.0</VersionLabel>
  </ListItem>
  <ListItem>
    <CheckInComment></CheckInComment>
    <Created>8/25/2021 5:23:56 PM</Created>
    <CreatedBy>balexander@pmg.net</CreatedBy>
    <ID>1024</ID>
    <IsCurrentVersion>False</IsCurrentVersion>
    <Length>45986</Length>
    <Url>_vti_history/1024/Shared Documents/Policies and Procedures/Source Documents/PMG Asset Disposal Policy.docx</Url>
    <VersionLabel>2.0</VersionLabel>
  </ListItem>
</ListItemCollection>

Variable for Error Messages: An optional variable to store any error messages from the transaction

# Add Fields To List

SharePoint action icon

Action Function:

The Add Fields To List action will add one or more fields to a List.

Action Properties:

Scenario: The connection scenario to use for the action

Site Name: The path to the related site, e.g.

/sites/mysite

**List Name: ** The name of the list to add fields

Fields Table: This property presents a dialog to define the one or more fields to be added to the list. An example screen is below.

SharePoint List New Fields Example

To add new fields, provide a Name, Display Name, Type, "Add New If Exists", and "Add Field Option" for each entry. The Add Field Option provides for various behavior configurations for the newly added field and newly added entries.

Error Message Variable: An optional variable to store any error messages from the transaction

# Add List Item

SharePoint action icon

Action Function:

The Add List Item action will add an item to a List.

Action Properties:

Scenario: The connection scenario to use for the action

Site Name: The path to the related site, e.g.

/sites/mysite

**List Name: ** The name of the list to add fields

Argument Name Value Pairs List: The argument name value pairs list to use for the update. An example is below.

Title=V{{Title}},Location=V{{Location}},Category=V{{Category}},Description=V{{Invite Description}},EventDate=V{{Adjusted Start}},EndDate=V{{Adjusted End}}

# Add Permission To List

SharePoint action icon

Action Function:

The Add Permission To List action will add a permission for a principal (user or group) to a list.

Action Properties:

Scenario: The connection scenario to use for the action

Site Name: The path to the related site, e.g.

/sites/mysite

**List Name: ** The name of the list to add permission

**Principal Type: ** The principal type to add, i.e. "User" or "Group"

Principal Login: The principal login for the principal to add

Role Definition Name: The name of the role definition to grant the user, i.e. "Full Control"

Error Message Variable: An optional variable to store any error messages from the transaction

# Assign Group Owner

SharePoint action icon

Action Function:

The Assign Group Owner action defines an owner for a group.

Action Properties:

Scenario: The connection scenario to use for the action

Site Name: The optional path to related site, e.g.

/sites/mysite

**New Owner: ** The ID of the new owner

**Group Name: ** The group name to modify

Error Message Variable: An optional variable to store any error messages from the transaction

# Check In File

SharePoint action icon

Action Function:

The Check In File will perform a check in activity for a given file

Action Properties:

Scenario: The connection scenario to use for the action

Site Name: The path to related site, e.g.

/sites/mysite

Sharepoint Relative File URL: The relative path to the file, e.g.

V{{NewListName}}/X{{GetListItems.ListItemCollection/ListItem/FileLeafRef}}

Comment: an optional comment to log with the activity

**Check In Type: ** The type of check in to perform for the given file

Result: a variable to store the result message of the check in activity

# Check Out File

SharePoint action icon

Action Function:

The Check In File will perform a check out activity for a given file

Action Properties:

Scenario: The connection scenario to use for the action

Site Name: The path to related site, e.g.

/sites/mysite

Sharepoint Relative File URL: The relative path to the file, e.g.

V{{NewListName}}/X{{GetListItems.ListItemCollection/ListItem/FileLeafRef}}

Result: a variable to store the result message of the check out activity

# Copy File

SharePoint action icon

Action Function:

The Copy File activity copy a source file to a target destination.

Action Properties:

Scenario: The connection scenario to use for the action

Site Name: The path to related site, e.g.

/sites/mysite

Sharepoint Relative File URL: The relative path to the source file, e.g.

V{{NewListName}}/X{{GetListItems.ListItemCollection/ListItem/FileLeafRef}}

Destination Relative File URL: The relative path to the target file, e.g.

V{{NewListName}}/X{{GetListItems.ListItemCollection/ListItem/FileLeafRef}}

Overwrite Existing File: Determines whether to overwrite the target file if it already exists.

Result: a variable to store the result message of the activity

# Create Folder

SharePoint action icon

Action Function:

The Create Folder activity creates a folder.

Action Properties:

Scenario: The connection scenario to use for the action

Site Name: The path to related site, e.g.

/sites/mysite

Parent Folder Relative URL The relative path to the parent folder for the new folder

List or Library Name: The list or library name of the container for the folder

New Folder Name: The name of the new folder

Result: a variable to store the result message of the activity

# Create Group

SharePoint action icon

Action Function:

The Create Group activity creates a group.

Action Properties:

Scenario: The connection scenario to use for the action

Site Name: The path to related site, e.g.

/sites/mysite

Group Name: The name of the new group

Description: A description for the new group

# Create List

SharePoint action icon

Action Function:

The Create List action creates a new list.

Action Properties:

Scenario: The connection scenario to use for the action

Site Name: The path to related site, e.g.

/sites/mysite

**List Name: ** The name of the list to add permission

List Description: The description for the new list

Template ID: The ID of the template to use for the new list

Result: a variable to store the result message of the activity

# Create Site

SharePoint action icon

Action Function:

The Create Site action creates a new site.

Action Properties:

Scenario: The connection scenario to use for the action

Name: The name for the new site

**Site URL: ** The URL for the new site

Title: The title for the new site

Description: The description for the new site

Locale ID: The locale ID to use for the new site

SharePoint Web Template: An optional template to use for the new site

Use Parent Permissions: Determines whether to use the parent site permissions

# Create Site Collection

SharePoint action icon

Action Function:

The Create Site Collection action creates a new site collection.

Action Properties:

Scenario: The connection scenario to use for the action

SharePoint Site Path: The SharePoint site path to use

Site Collection URL: The URL of the site collection

Title: The title for the new site collection

Description: The description for the new site collection

Locale ID: The locale ID to use for the new site collection

SharePoint Web Template: An optional template to use for the new site collection

Owner Login: The login of the owner ID for the site collection

Compatibility Level: The compatibility level to set

Storage Maximum Level: The storage maximum level to use

Storage Warning Level: The storage warning level to use

User Code Maximum Level: The user code maximum level to use

User Code Warning Level: The user code warning level to use

Time Zone ID: The time zone ID for the collection

Sharing Capabilities: The sharing capabilities for the collection

# Delete File

SharePoint action icon

Action Function:

The Delete File action deletes a file.

Action Properties:

Scenario: The connection scenario to use for the action

Site Name: The path to related site, e.g.

/sites/mysite

Relative File Path: The path of the file to delete

# Delete List

SharePoint action icon

Action Function:

The Delete List action deletes a list.

Action Properties:

Scenario: The connection scenario to use for the action

Site Name: The path to related site, e.g.

/sites/mysite

List Name: The name of the list to delete

# Edit Site Collection Admin

SharePoint action icon

Action Function:

The Edit Site Collection Admin action sets or removes an administrator for a site collection

Action Properties:

Scenario: The connection scenario to use for the action

Site Path: The path to related site, e.g.

/sites/mysite

User Login Name: The login name of the user to be added or removed from the site collection

Add or Remove: Determines whether to add or remove the login

# Get List Items

SharePoint action icon

Action Function:

The Get List Items action retrieves items from a list

Action Properties:

Scenario: The connection scenario to use for the action

Site Path: The path to related site, e.g.

/sites/mysite

List Name: The name of the list to retrieve

Relative Folder Url: The relative folder for the list. e.g.

/sites/InfoSecurity/Shared Documents/Policies and Procedures/Source Documents

CAML Query: The CAML query to retrieve the list. An example is below.

<View>
    <Query>
        <OrderBy>
            <FieldRef Name='FileLeafRef'/>
        </OrderBy>
    </Query>
    <ViewFields>
        <FieldRef Name='FileLeafRef'/>
    </ViewFields>
    <RowLimit>20</RowLimit>
</View>

Position Info: The position information for the retrieval. An example is below.

Paged=TRUE&p_SortBehavior=0&p_FileLeafRef=PMG%20SaaS%20Change%20Management%20Policy%2edocx&p_ID=65&RootFolder=%2fsites%2fInfoSecurity%2fShared%20Documents%2fPolicies%20and%20Procedures%2fSource%20Documents

Results Variable: A variable to store the results. An example response is below.

<ListItemCollection>
    <ListItem>
        <FileLeafRef>SaaS Encryption and Data.docx</FileLeafRef>
    </ListItem>
    <ListItem>
        <FileLeafRef>SaaS Incident Management Policy.docx</FileLeafRef>
    </ListItem>
    <ListItem>
</ListItemCollection>

Error Messages Variable: An optional variable to store activity error messages

# Move File

SharePoint action icon

Action Function:

The Move File activity moves a source file to a target destination.

Action Properties:

Scenario: The connection scenario to use for the action

Site Name: The path to related site, e.g.

/sites/mysite

Sharepoint Relative File URL: The relative path to the source file, e.g.

V{{NewListName}}/X{{GetListItems.ListItemCollection/ListItem/FileLeafRef}}

Destination Relative File URL: The relative path to the target file, e.g.

V{{NewListName}}/X{{GetListItems.ListItemCollection/ListItem/FileLeafRef}}

Result: a variable to store the result message of the activity

# Rename List Field

SharePoint action icon

Action Function:

The Move File activity moves a source file to a target destination.

Action Properties:

Scenario: The connection scenario to use for the action

Site Name: The path to related site, e.g.

/sites/mysite

List Name: The name of the list to modify

Original Name: The original name of the field

New Name: The new name of the field

Error Messages Variable: An optional variable to store activity error messages

# Update List Item

SharePoint action icon

Action Function:

The Move File activity moves a source file to a target destination.

Action Properties:

Scenario: The connection scenario to use for the action

Site Name: The path to related site, e.g.

/sites/mysite

List Name: The name of the list to modify

Argument Name Value Pairs List: The argument name value pairs list to use for the update. An example is below.

Title=V{{Title}},Location=V{{Location}},Category=V{{Category}},Description=V{{Invite Description}},EventDate=V{{Adjusted Start}},EndDate=V{{Adjusted End}}

CAML Query Variable: A variable containing the CAML query XML to use for the update

# Upload Files

SharePoint action icon

Action Function:

The Upload Files action uploads files to SharePoint

Action Properties:

Scenario: The connection scenario to use for the action

Site Name: The path to the related site, e.g.

/sites/mysite

**Relative Folder URL: **The relative URL to store the files, e.g.

/sites/mysite/Shared Documents/TestFolder

Files: Provides for a comma separated list of form field mapping names to send files which are attached to a submitted form

File Variable: Specifies a file variable to upload

Check In Option: Sets the check in method to use for the new files

Result: an optional variable to store the result of the activity

# Upload Request Files

SharePoint action icon

Action Function:

The Upload Files action uploads files from a submitted form or request to SharePoint

Action Properties:

Scenario: The connection scenario to use for the action

Site Name: The path to the related site, e.g.

/sites/mysite

**Relative Folder URL: **The relative URL to store the files, e.g.

/sites/mysite/Shared Documents/TestFolder

Check In Option: Sets the check in method to use for the new files

Result: an optional variable to store the result of the activity

# Update Folder Permission

SharePoint action icon

Action Function:

The Update Folder Permission action updates permissions for a folder.

Action Properties:

Scenario: The connection scenario to use for the action

Site Name: The path to the related site, e.g.

/sites/mysite

**Relative Folder URL: **The relative URL to modify

/sites/mysite/Shared Documents/TestFolder

**Principal Type: ** The principal type to add, i.e. "User" or "Group"

Principal Login: The principal login for the principal to add

Role Definition Name: The name of the role definition to grant the user, i.e. "Full Control"

Error Message Variable: An optional variable to store any error messages from the transaction

#