SharePoint Online - Store a file

Use the SharePoint Online - Store a file action A tool for building the processes, logic, and direction within workflows. to store a file in a specified SharePoint Online document library.

You can use this action with the SharePoint Online - Get a file action.

For more information about the SharePoint Online connector, go to SharePoint Online.

Configure the SharePoint Online - Store a file action

Important: Before inserting variables in the action configuration, you must manually type or select the values and populate other dependent fields in order to retrieve the output data. Once configured, you can insert variables to the required fields.

  1. Add the action to the workflow and open the action configuration panel. For more information, see Add, rename, and copy actions.

  2. Select a SharePoint Online Connection. If you do not have a connection, see Add a connection.

  3. Note: 

    Only the connections created with the List and libraries authentication method will be available in the drop-down list.

    For more information about authentication methods for SharePoint Online connections, see Authentication methods for SharePoint Online connections.

  1. In the File field, insert a variable to specify the file you want to store.
  2. Type the SharePoint site URL that has the document library you want to store the file in and click Retrieve libraries.
  3. Example: https://domain.sharepoint.com/sites/hr

    All the document libraries in the specified site are displayed in the Document library field drop-down list.

  1. Select the Document library in which you want to store the file.
  2. Select Yes or No in Overwrite file to specify if you want to overwrite if a file with the same name exists in the destination document library.

SharePoint Online - Store a file action fields and settings

Important: Before inserting variables in the action configuration, you must manually type or select the values and populate other dependent fields in order to retrieve the output data. Once configured, you can insert variables to the required fields.

Section Field Description Variable types
(unlabeled)

Connection Credentials and other settings required to pass data between the workflow and the indicated service, which could be a cloud service, business application, or content store.

SharePoint Online connection to access the SharePoint Online site to use for the action.

To refresh the available connections, click Refresh.

(n/a)
Source file File

The file to store in a SharePoint Online document library.

Click + Insert or click on the field to Open the Insert variables window and select the file variable.

File
Destination location

SharePoint site URL

The URL of the SharePoint Online site containing the document library you want to use.

To retrieve the libraries for the SharePoint site URL, type the SharePoint site URL and click Retrieve libraries.

Example: https://domain.sharepoint.com/sites/hr

Text, Decimal, Integer, Boolean, DateTime, Collection

  Document library

The document library you want to store the file in.

When you specify the SharePoint Online site URL, the document libraries in the selected site will be available to select from in the Document library drop-down list.

Text, Decimal, Integer, Boolean, DateTime, Collection
  Folder path

The path for the location of the file.

Example: /documents/drafts

Note: 
  • If a folder path is not specified, the file is saved to the root level of the document library.
  • If the folder does not exist in the specified path, a new folder is created.
Text, Decimal, Integer, Boolean, DateTime, Collection
  Overwrite file

Select Yes or No to specify whether you want to overwrite any existing file that has the same name in the destination.

  • Yes: If a file with the same file name exists in the destination library, it will be replaced with the new document.
  • No: If No is selected and a file with the same file name exists in the destination, the workflow will fail.
Boolean
Output Result

Stores the result of the action in an object with the following variables:

  • Document library name: Text variable to store the name of the document library the file is stored.
  • File name: Text variable to store the name of the stored file.
  • File path: Text variable to store the new path of the stored file.
  • File URL: Text variable to store the URL of the file in the new destination.
  • Folder path: Text variable to store the new folder path.
  • Item ID: Integer variable to store the ID of the file.
  • Site URL: Text variable to store the URL of the site the file is stored in.
Object