Use the Assign file action to open a file stream for a SharePoint file and assign it to a file variable. The FileStream allows the API Tasks to run automation on files without downloading them to the local desktop or within the Control Room storage.

You can use the Assign file action for all file types that SharePoint supports.

For example, use the Assign file action to open a file stream for a text file located in a SharePoint location and assign it to a text file variable. You can then use this text file variable for automations that use the Upload file, Upload list image, and Upload list attachment actions.

Prerequisites

  • Ensure that you are logged in to the Control Room with appropriate permissions.
  • Ensure that you are authenticated before initiating any SharePoint action. For more details, see Configure OAuth connections in Control Room.

Procedure

  1. From the Actions pane, select SharePoint > Folder and file > Assign file and place it in the canvas.
  2. In the Site section, select one of the following options:
    • Default site: The SharePoint site name used during authentication is considered the default site.

      For example: SiteAssets/FileName.txt

    • Other site: If you want to choose a different SharePointsite, specify the different site name.

      For example: https://{subdomain}.sharepoint.com/site/{SiteName}

  3. In the Session section, select one of the following options:
    • Session name: Specify the name you provided for the session during authentication.
    • Variable: Select a variable that was created for the session during the authentication.
  4. In the Assign file to a variable section, specify the file variable that is used to reference the file path.
    You can use the Create variable option to create a file variable or select an existing file variable using the drop-down option.
A file stream is opened for the specified SharePoint file. You can add other actions and proceed with creating automation.