---
sourceDocument: Yokohama ServiceNow AI Platform Capabilities
sourceDocumentLink: https://www.servicenow.com/docs/r/yokohama/servicenow-platform

 Release :

    - yokohama

ft:locale :

    - en-US

ft:publication_title :

    - Yokohama ServiceNow AI Platform Capabilities

ft:clusterId :

    - platcap

bundleId :

    - platcap

workflow :

    - Platform


---

# Set File Attributes activity

# Set File Attributes activity {#ariaid-title1}

* Release version: Yokohama
* 
* Updated January 30, 2025
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 1 minute to read

The Set File Attributes activity sets common file attributes, such as timestamps, size,
permissions, and UID/GID, for a file or directory on an SFTP server.
A good practice is to use the Get File List activity to return a list of files and their
attributes first. Then, when you moved a file from a source host to a target host, use the
Set File Attributes activity to set the source file attributes on the target file. This is
demonstrated in the [SFTP File Transfer](https://www.servicenow.com/docs/cH6aW0o2LbQa4RjbASQzjA "The SFTP File Transfer activity pack includes a scoped workflow that uses multiple activities to manage files on SFTP servers.")workflow.

## Input variables

{#r_SetFileAttributesActivity__table_mbr_hxv_mt__entry__2}

| Variable | Description |
|-|-|
| sourceHost | Name or IP address of the server containing the file or directory whose attributes you want to change. |
| sourcePort | Port number to use to communicate with the target server. The default port number is 22. |
| sourceFilePath | Full path to the file or directory whose attributes you want to change. |
| userID | User ID attribute to apply to the file or directory. The UID and GUID variables must be set together as a pair. |
| groupID | Group ID attribute to apply to the file or directory. The UID and GUID variables must be set together as a pair. |
| permissions | File or directory permissions to set for the user and group specified. This value must be expressed as an integer, such as 16877, which defines these permissions: rwxr-xr-x. Note: The permissions number is an internal value returned by the Get File List activity. |
| accessTimestamp | Override the timestamp when the file or directory was last accessed. The access and modification timestamps must be set together as a pair. |
| modificationTimestamp | Override the timestamp when the file or directory was last modified. The access and modification timestamps must be set together as a pair. |
| sizeInBytes | Size of the file or directory, expressed in bytes. |
| sourceCredentialTag | Specific [Credential aliases for Orchestration activities](https://www.servicenow.com/docs/access?context=c_AssignCredsOrchActivities&version=yokohama&pubname=yokohama-platform-security&ft:locale=en-US) this activity must use to run SSH commands on the host. |
[Table 1. Set File Attributes input variables]

{#r_SetFileAttributesActivity__table_mbr_hxv_mt}

## Output variables

{#r_SetFileAttributesActivity__table_ojq_lhw_mt__entry__2}

| Variable | Description |
|-|-|
| errorMessage | The executionResult.errorMessages from the [Activity designer parsing sources](https://www.servicenow.com/docs/5fX1CXeRKshOet1fu0DglA#r_ActivityDesignerParsingSources "This table lists the parsing sources available with each execution template."). If this variable is not null, the operation has failed. |
| result | Text message advising that the command was executed successfully. |
[Table 2. Set File Attributes output variables]

{#r_SetFileAttributesActivity__table_ojq_lhw_mt}

## Conditions

{#r_SetFileAttributesActivity__table_dsl_5kw_mt__entry__2}

| Condition | Description |
|-|-|
| Success | The activity succeeded in changing the attributes of the specified file or directory. |
| Failure | The activity failed to change the attributes of the specified file or directory. |
[Table 3. Set File Attributes conditions]

{#r_SetFileAttributesActivity__table_dsl_5kw_mt}

