spRenameDocument Step
Description:
The Rename Document workflow step renames a document in a SharePoint site using the configured SharePoint site URL, OAuth provider, document path, and new document name.
The step supports:
- Specifying the BaseURL for the SharePoint site.
- Selecting an OAuth provider for authentication.
- Specifying the path of the document to be renamed.
- Specifying the new name for the document.
- Storing the operation result in a FlowWright Variable or global variable.
- Routing the workflow through True or False return paths.
The step can be used for:
- Document lifecycle management
- Document status changes
- Project document organization
- Automated document naming
- Document archival workflows
- Customer or case document management
- Standardizing document names
- Workflow-driven SharePoint document organization
The XML defines the step as a SharePoint process step named sprenamedocument, implemented by FlowWright.Workflow.dll, with the namespace FlowWright.Workflow.SpRenameDocument.
Inputs
- BaseURL – Specifies the BaseURL for the SharePoint site.
- selOAuthProvider - Selects the OAuth provider used to access SharePoint.
- documentPath – Specifies the path supplied to the step for the document operation.
- renamedTo – Specifies the new name supplied for the rename operation.
- resultJson – Specifies the FlowWright Variable or Global in which the operation result is stored.
Returns
- True – Step executed successfully
- False – Step failed to execute
Usage:
The Rename Document step is typically placed after a workflow has identified a SharePoint document and determined its name.
The workflow can dynamically determine the rename information using Variables, Globals, previous workflow outputs, form values, or information retrieved from external systems.
A typical workflow can be structured as:
Start
│
▼
Identify SharePoint Document
│
▼
Determine New Document Name
│
▼
Rename Document
│
├──► True ──► Continue Workflow
│
└──► False ──► Handle Failure
The renamed document can then be used by subsequent workflow steps for further processing.

To use this step, configure SharePoint with Flowwright OAuth connections.

A sample SharePoint OAuth configuration is included here for reference.

Typical Workflow Suggestions.
Rename a Document After Approval
A document can be renamed after an approval activity completes.
For example, a workflow could rename a document to reflect its approved status.
Rename a Document After Processing
Use Rename Document after a document has completed a processing stage.
This can help establish consistent document naming throughout a workflow.
Document Lifecycle Management
Use the step to reflect document lifecycle changes through the document name.
The workflow can determine the appropriate new name before invoking the SharePoint operation.
Project Document Management
Use Rename Document to standardize project-related documents.
A workflow Variable or global variable can be used to construct the desired document name.
Customer or Case Documents
Use the step when a customer or case workflow needs documents to follow a consistent naming convention.
This can make documents easier to identify in SharePoint.
Automated Document Naming
Use workflow data to dynamically determine the new document name.
The XML exposes the new-name value through the renamedTo property.
Handle Rename Results
Use the True and False paths to provide explicit handling of success and failure.
The two return paths are defined by the step XML.
Example:
Let’s build and execute the “spRenameDocumentDef” example.
- Create a new definition called “spRenameDocumentDef" and open the definition in designer mode.
- Drag a “spRenameDocument” step to the canvas.
- Connect the dots between the “Start” and “spRenameDocument” steps, as shown above.
- Select the line between the steps to configure the “Connection Properties”. The default property values are “None, True, False, Error, and Evaluate ”. Depending on the step’s purpose, additional values are available for configuration.
- Define a variable or a global variable to store the file path and the result.
- Click the "spRenameDocument" step to configure its "Required" properties. Provide a name for the step. Provide the base URL for your SharePoint site. Select the SharePoint OAuth provider from the dropdown. Provide the path to the document folder to rename and the new name. Provide a variable or a global reference to store the result. Click the Save button. Note: Click the "AI Predict" button for the Copilot to add new process steps that match your process description.

- The “Logging” configuration is necessary for documentation and also measures workflow progress and percent complete. This is achieved by configuring the step state and percent fields individually, as shown in the images below. Configure the “Logging” using the following properties.

- Save the process definition, create a new instance, execute it, and then render the process instance. The process step should rename the document on the SharePoint site as configured. When the workflow reaches the Rename Document step, it uses the configured SharePoint connection information and supplied path/name values to perform the operation. The result is stored in the configured Variable or Global.
Tips:
- Verify the SharePoint BaseURL before executing the workflow.
- Select the correct OAuth provider.
- Verify that the supplied path identifies the intended SharePoint document.
- Use a consistent document-naming convention.
- Use Variables or Globals when the new name needs to be generated dynamically.
- Store the operation result in a clearly named Variable or Global.
- Use the False return path for appropriate error handling.
- Test the SharePoint authentication and path configuration before deploying the workflow.
- Be careful when renaming documents that are referenced by later workflow activities.
- Consider downstream links, references, or workflow logic that may depend on the original document name.
- Verify the expected format of the path and new-name values against the FlowWright SharePoint implementation.
- Do not infer the structure of the stored result from the XML; the XML only defines the destination property.
Notes:
- The step belongs to the SharePoint category.
- The display name is Rename Document.
- The step name is
sprenamedocument. - The step label is Rename a SharePoint document.
- The namespace is
FlowWright.Workflow.SpRenameDocument. - The step is implemented by
FlowWright.Workflow.dll. - The step is defined as a Process step.
- The definition specifies two input connections and two output connections.
- BaseURL is required.
- Select OAuth provider is required.
- The path to the folder to be renamed is required.
- Rename Folder to is required.
- Storing the result in a Variable/Global is required.
- The OAuth provider uses the
SelOAuthProviderdata type. - The string properties use
FlowWright.DataTypes.ClsTextBox. - The step provides True and False return values.
- The XML does not specify the exact SharePoint path syntax.
- The XML does not specify the exact structure of the result stored in the configured Variable or Global.
- The XML does not specify the runtime conditions that produce the True or False result.
- The XML does not document handling of authentication failures, SharePoint API errors, retries, timeouts, or cancellation behavior.
Recommended Workflow Pattern:
A useful pattern for Rename Document is to separate document identification, name generation, SharePoint processing, and result handling.

This pattern makes the SharePoint rename operation explicit and provides a clear location for handling an unsuccessful operation.
Definition Sample:
You may download the sample definition(s) from the link here and later import them (drag-and-drop) to your FlowWright Process Definition (XML file) or Form Definition (HTML file) page.
Note: Verify and complete the configuration after importing the sample, particularly the SharePoint BaseURL, OAuth provider, path, new name, result Variable/Global, and environment-specific settings.
Click here to download the sample file.