SharePoint Online - Rename a file

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

Before you start 

Configure the SharePoint Online - Rename a file action

The steps required to configure the action are given below. The SharePoint Online - Rename a file action fields and settings table describes all the required and optional configuration fields.

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. Select a Connection.
  2. Note: 

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

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

  1. Select an option in Specify source by to define how you want to select the source file that you want to rename. The configuration fields that display in the Source file section depend on the option selected.
  2. Type the SharePoint site URL that has the document library with the file you want to rename and click Retrieve libraries.

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

    All the document libraries in the specified site displays in a drop-down list in the Document library field to select from.

  3. Note: Retrieve libraries is not displayed if the Specify source by option you select is URL.

  1. Depending on the option selected in Step 3 do the following to choose the source file you want to rename:

    Note: The fields displayed depend on the Specify source by option selected.

  1. In the New file name section, enter the new name for the file in File name.

SharePoint Online - Rename 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 use for the SharePoint Online site.

To refresh the available connections, click Refresh.

(n/a)
Source file Specify source by

Select one of the following options to determine how you want to specify the source file that you want to rename:

Note: The configuration fields that are displayed in the Source file section depend on the option selected for Specify source by.

  • Choose file: Specify the source file using the document library and the path to the file.
  • Item ID: Specify the source using the Item ID.
  • URL:  Specify source file using the direct URL to the file.
(n/a)
  SharePoint site URL

The URL of the SharePoint Online site that has the list or document library you want to use.

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

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

Boolean, Collection, DateTime, Decimal, Integer, Text
 

Document library

(Available only if Choose file or Item ID is selected in the Specify source by field).

The name of the document library that has the file you want to rename.

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.

Boolean, Collection, DateTime, Decimal, Integer, Text

 

File path

(Available only if Choose file or URL is selected in the Specify source by field).

The path, including file name and extension, for the file you want to rename. If the file is inside a folder, include the folder name followed by the file name in the file path.

Example: /report/report.pdf

If the Specify source by option selected is URL, include the document library name in the file path.

For example, if the file is contained in the report folder inside a document library named library, include the document library name and the folder name in the file path:

/library/report/report.pdf

Note: 
  • If the file is located in a folder, include the folder name in file path. Example: /reports/report.pdf
  • If the file is not inside a folder, you can type only the filename with the file extension. Example: /report.pdf
  • If the given File path is incorrect, does not follow the expected format or does not exist the workflow will fail.

Boolean, Collection, DateTime, Decimal, Integer, Text

  Item ID

(Available only if Item ID is selected in the Specify source by field).

The ID of the list item you want to rename.

Integer
New file name File name

The new name for the file.

Boolean, Collection, DateTime, Decimal, Integer, Text
Output

Result

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

  • Item ID: Integer variable to store the ID of the renamed file.
  • File URL: Text variable to store the URL of the renamed file.
  • Document library name: Text variable to store the name of the document library the file is included in.
  • Folder path: Text variable to store the path to the folder that the renamed file is in.
  • File name: Text variable to store the name of the renamed file.
  • File path: Text variable to store the path of the renamed file.

Object A variable that groups several related variables of any type into a hierarchical structure. Objects can contain other Objects.