Get started with the SharePoint Online connector

Use the SharePoint Online connector to manage SharePoint lists.

To use any connector, you first need to create a logic app. You can get started by creating a logic app now.

Connect to SharePoint Online

Before your logic app can access any service, you first need to create a connection to the service. A connection provides connectivity between a logic app and another service.

Create a connection to SharePoint Online

In order to connect to SharePoint Online, you need to provide your identity (username and password, smart card credentials, etc.) to SharePoint Online. Once you've been authenticated, you can proceed to use the SharePoint Online connector in your logic app.

While on the designer of your logic app, follow these steps to sign into SharePoint to create the connection for use in your logic app:

  1. Enter SharePoint in the search box and wait for the search to return all triggers and actions related to SharePoint Online:
    Configure SharePoint
  2. Select the SharePoint Online - When a file is created trigger
  3. Select Sign in to SharePoint Online:
    Configure SharePoint
  4. Provide your SharePoint credentials to sign in to authenticate with SharePoint
    Configure SharePoint
  5. After the authentication completes you'll be redirected to your logic app. That's it, the connection has been created. Notice the message at the bottom that indicates that you are now connected to SharePoint.
    Configure SharePoint
  6. You can then add other triggers and actions that you need to complete your logic app.

Use a SharePoint Online trigger

A trigger is an event that can be used to start the workflow defined in a logic app. Learn more about triggers.

In this example, I will show you how to use the SharePoint Online - When a new item is created trigger to initiate a logic app workflow when a new item is created in a SharePoint Online list.

Note

You will get prompted to sign into your SharePoint account if you have not already created a connection to SharePoint Online.

  1. Enter sharepoint in the search box on the logic apps designer then select the SharePoint Online - When a new item is created trigger.
    SharePoint online trigger image
  2. The When a new item is created control is displayed.
    SharePoint online trigger image 2
  3. Select a Site URL. This is the SharePoint online site you want to monitor for new items to trigger your workflow.
    SharePoint online trigger image 3
  4. Select a List name. This is the list on the SharePoint Online site you want to monitor for new items that will trigger your workflow.
    SharePoint online trigger image 4

At this point, your logic app has been configured with a trigger that will begin a run of the other triggers and actions in the workflow. This will take place each time a new item is created in SharePoint Online list you selected.

Use a SharePoint Online action

An action is an operation carried out by the workflow defined in a logic app. Learn more about actions.

Now that you have added a trigger, its time to do something interesting with the data that's generated by the trigger. Follow these steps to add the SharePoint Online - Create file action. This action will create a file in SharePoint Online each time the new item trigger fires.

To configure the this action, you will need to provide the following information. As you provide this information, you will notice that it is easy to use data generated by the trigger as input for some of the properties for the new file:

Create file property Description
Site URL This is the URL of the SharePoint Online site where you want to create the new file. Select the site from the list presented.
Folder path This is the folder (at the Site URL selected in the previous step) where the new file will be placed. Browse for and select the folder.
File name This is the name of the file being created.
File content The content that will be written to the file.
  1. Select + New step to add the action.
    SharePoint online action image 1
  2. Select the Add an action link. This opens the search box where you can search for any action you would like to take. For this example, SharePoint actions are of interest.
    SharePoint online action image 2
  3. Enter sharepoint to search for actions related to SharePoint.
  4. Select SharePoint Online - Create file as the action to take. Note: you will be prompted to authorize your logic app to access your SharePoint account if you have not created a connection to SharePoint Online previously.
    SharePoint online action image 3
  5. The Create file control opens.
    SharePoint online action image 4
  6. Select Site URL and browse to find the site where you would like to create the file.
    SharePoint online action image 5
  7. Select Folder path and browse to find the folder where the new file will be placed.
    SharePoint online action image 6
  8. Select the File name control and enter the name of the file you want to create. Here, you can either enter the file name directly or you can use any of the properties from the trigger you created previously. You do this by selecting properties from the list of Outputs from When a new item is created. This list is only display after you select the File name control. In this walkthough, I selected ID (the ID of the new list item) as the name of the file being created by the SharePoint Online - Create file action.
    SharePoint online action image 7
  9. Select the File content control and enter the content that will be written to the file that will be created. For the file content, notice that you can use any of the properties from the trigger you created previously. Simply select the properties from the list presented. Alternatively, you can enter the File content text directly into the control. In this example, I selected some properties and added spaces and a hyphen between each property.
    SharePoint online action image 8
  10. Save the changes to your workflow
  11. Congratulations, you now have a fully functional logic app that is triggered when a new item is added to a SharePoint Online list. The app will then create a file, using some of the properties from the new list item. You can now test it by creating a new item in the SharePoint list.

Technical Details

Here are the details about the triggers, actions and responses that this connection supports:

SharePoint Online triggers

SharePoint has the following trigger(s):

Trigger Description
When a file is created This operation triggers a flow when a new file is created in a SharePoint folder.
When a file is modified This operation triggers a flow when a file is modified in a SharePoint folder.
When a new item is created This operation triggers a flow when a new item is created in a SharePoint list.
When an existing item is modified This operation triggers a flow when an existing item is modified in a SharePoint list.

SharePoint Online actions

SharePoint has the following actions:

Action Description
Get file metadata This operation gets file metadata using the file id.
Update file This operation updates file content.
Delete file This operation deletes a file.
Get file metadata using path This operation gets file metadata using the file path.
Get file content using path This operation gets file contents using the file path.
Get file content This operation gets file content using the file id.
Create file This operation uploads a file to a SharePoint site.
Copy file This operation copies a file to a SharePoint site.
List folder This operation gets files contained in a SharePoint folder.
List root folder This operaiton gets the files in the root SharePoint folder.
Extract folder This operation extracts an archive file into a SharePoint folder (example: .zip).
Get items This operation gets items from a SharePoint list.
Create item This operation creates a new item in a SharePoint list.
Get item This operation gets a single item by its id from a SharePoint list.
Delete item This operation deletes an item from a SharePoint list.
Update item This operation updates an item in a SharePoint list.
Get entity values This operation gets possible values for a SharePoint entity.
Get lists This operation gets SharePoint lists from a site.

Action details

Here are the details for the actions and triggers for this connector, along with their responses:

Get file metadata

This operation gets file metadata using the file id.

Property Name Display Name Description
dataset* Site URL SharePoint site url like http://contoso.sharepoint.com/sites/mysite
id* File identifier Select a file

An * indicates that a property is required

Output Details

BlobMetadata

Property Name Data Type
Id string
Name string
DisplayName string
Path string
LastModified string
Size integer
MediaType string
IsFolder boolean
ETag string
FileLocator string

Update file

This operation updates file content.

Property Name Display Name Description
dataset* Site URL SharePoint site url like http://contoso.sharepoint.com/sites/mysite
id* File identifier Select a file
body* File Content Content of the file

An * indicates that a property is required

Output Details

BlobMetadata

Property Name Data Type
Id string
Name string
DisplayName string
Path string
LastModified string
Size integer
MediaType string
IsFolder boolean
ETag string
FileLocator string

Delete file

This operation deletes a file.

Property Name Display Name Description
dataset* Site URL SharePoint site url like http://contoso.sharepoint.com/sites/mysite
id* File identifier Select a file

An * indicates that a property is required

Get file metadata using path

This operation gets file metadata using the file path.

Property Name Display Name Description
dataset* Site URL SharePoint site url like http://contoso.sharepoint.com/sites/mysite
path* File path Select a file

An * indicates that a property is required

Output Details

BlobMetadata

Property Name Data Type
Id string
Name string
DisplayName string
Path string
LastModified string
Size integer
MediaType string
IsFolder boolean
ETag string
FileLocator string

Get file content using path

This operation gets file contents using the file path.

Property Name Display Name Description
dataset* Site URL SharePoint site url like http://contoso.sharepoint.com/sites/mysite
path* File path Select a file

An * indicates that a property is required

Get file content

This operation gets file content using the file id.

Property Name Display Name Description
dataset* Site URL SharePoint site url like http://contoso.sharepoint.com/sites/mysite
id* File identifier Select a file

An * indicates that a property is required

Create file

This operation uploads a file to a SharePoint site.

Property Name Display Name Description
dataset* Site URL SharePoint site url like http://contoso.sharepoint.com/sites/mysite
folderPath* Folder Path Select a file
name* File name Name of the file
body* File Content Content of the file

An * indicates that a property is required

Output Details

BlobMetadata

Property Name Data Type
Id string
Name string
DisplayName string
Path string
LastModified string
Size integer
MediaType string
IsFolder boolean
ETag string
FileLocator string

Copy file

This operation copies a file to a SharePoint site.

Property Name Display Name Description
dataset* Site URL SharePoint site url like http://contoso.sharepoint.com/sites/mysite
source* Source file Path Path to the source file
destination* Destination file path Path to the destination file
overwrite Overwrite flag Whether or not to overwrite the destination file if it exists

An * indicates that a property is required

Output Details

BlobMetadata

Property Name Data Type
Id string
Name string
DisplayName string
Path string
LastModified string
Size integer
MediaType string
IsFolder boolean
ETag string
FileLocator string

When a file is created

This operation triggers a flow when a new file is created in a SharePoint folder.

Property Name Display Name Description
dataset* Site URL SharePoint site url
folderId* Folder Id Select a folder

An * indicates that a property is required

When a file is modified

This operation triggers a flow when a file is modified in a SharePoint folder.

Property Name Display Name Description
dataset* Site URL SharePoint site url
folderId* Folder Id Select a folder

An * indicates that a property is required

List folder

This operation gets files contained in a SharePoint folder.

Property Name Display Name Description
dataset* Site URL SharePoint site url like http://contoso.sharepoint.com/sites/mysite
id* File identifier Unique identifier of the folder

An * indicates that a property is required

Output Details

BlobMetadata

Property Name Data Type
Id string
Name string
DisplayName string
Path string
LastModified string
Size integer
MediaType string
IsFolder boolean
ETag string
FileLocator string

List root folder

This operaiton gets the files in the root SharePoint folder.

Property Name Display Name Description
dataset* Site URL SharePoint site url like http://contoso.sharepoint.com/sites/mysite

An * indicates that a property is required

Output Details

BlobMetadata

Property Name Data Type
Id string
Name string
DisplayName string
Path string
LastModified string
Size integer
MediaType string
IsFolder boolean
ETag string
FileLocator string

Extract folder

This operation extracts an archive file into a SharePoint folder (example: .zip).

Property Name Display Name Description
dataset* Site URL SharePoint site url like http://contoso.sharepoint.com/sites/mysite
source* Source file Path Path to the source file
destination* Destination folder path Path to the destination folder
overwrite Overwrite flag Whether or not to overwrite the destination file if it exists

An * indicates that a property is required

Output Details

BlobMetadata

Property Name Data Type
Id string
Name string
DisplayName string
Path string
LastModified string
Size integer
MediaType string
IsFolder boolean
ETag string
FileLocator string

When a new item is created

This operation triggers a flow when a new item is created in a SharePoint list.

Property Name Display Name Description
dataset* Site url SharePoint site url (example: http://contoso.sharepoint.com/sites/mysite)
table* List name SharePoint list name
$filter Filter Query An ODATA filter query to restrict the entries returned
$orderby Order By An ODATA orderBy query for specifying the order of entries
$skip Skip Count Number of entries to skip (default = 0)
$top Maximum Get Count Maximum number of entries to retrieve (default = 256)

An * indicates that a property is required

Output Details

ItemsList

Property Name Data Type
value array

When an existing item is modified

This operation triggers a flow when an existing item is modified in a SharePoint list.

Property Name Display Name Description
dataset* Site url SharePoint site url (example: http://contoso.sharepoint.com/sites/mysite)
table* List name SharePoint list name
$filter Filter Query An ODATA filter query to restrict the entries returned
$orderby Order By An ODATA orderBy query for specifying the order of entries
$skip Skip Count Number of entries to skip (default = 0)
$top Maximum Get Count Maximum number of entries to retrieve (default = 256)

An * indicates that a property is required

Output Details

ItemsList

Property Name Data Type
value array

Get items

This operation gets items from a SharePoint list.

Property Name Display Name Description
dataset* Site url SharePoint site url (example: http://contoso.sharepoint.com/sites/mysite)
table* List name SharePoint list name
$filter Filter Query An ODATA filter query to restrict the entries returned
$orderby Order By An ODATA orderBy query for specifying the order of entries
$skip Skip Count Number of entries to skip (default = 0)
$top Maximum Get Count Maximum number of entries to retrieve (default = 256)

An * indicates that a property is required

Output Details

ItemsList

Property Name Data Type
value array

Create item

This operation creates a new item in a SharePoint list.

Property Name Display Name Description
dataset* Site url SharePoint site url (example: http://contoso.sharepoint.com/sites/mysite)
table* List name SharePoint list name
item* Item Item to create

An * indicates that a property is required

Output Details

Item

Property Name Data Type
ItemInternalId string

Get item

This operation gets a single item by its id from a SharePoint list.

Property Name Display Name Description
dataset* Site url SharePoint site url (example: http://contoso.sharepoint.com/sites/mysite)
table* List name SharePoint list name
id* Id Unique identifier of item to be retrieved

An * indicates that a property is required

Output Details

Item

Property Name Data Type
ItemInternalId string

Delete item

This operation deletes an item from a SharePoint list.

Property Name Display Name Description
dataset* Site url SharePoint site url (example: http://contoso.sharepoint.com/sites/mysite)
table* List name SharePoint list name
id* Id Unique identifier of item to be deleted

An * indicates that a property is required

Update item

This operation updates an item in a SharePoint list.

Property Name Display Name Description
dataset* Site url SharePoint site url (example: http://contoso.sharepoint.com/sites/mysite)
table* List name SharePoint list name
id* Id Unique identifier of item to be updated
item* Item Item with changed properties

An * indicates that a property is required

Output Details

Item

Property Name Data Type
ItemInternalId string

Get entity values

This operation gets possible values for a SharePoint entity.

Property Name Display Name Description
dataset* SharePoint site url SharePoint site url
table* table name table name
id* entity id entity id

An * indicates that a property is required

Output Details

Get lists

This operation gets SharePoint lists from a site.

Property Name Display Name Description
dataset* Site url SharePoint site url (example: http://contoso.sharepoint.com/sites/mysite)

An * indicates that a property is required

Output Details

TablesList

Property Name Data Type
value array

HTTP responses

The actions and triggers above can return one or more of the following HTTP status codes:

Name Description
200 OK
202 Accepted
400 Bad Request
401 Unauthorized
403 Forbidden
404 Not Found
500 Internal Server Error. Unknown error occurred.
default Operation Failed.

Next Steps

Create a logic app