{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":4360,"path":"build-workflows/workflow-studio/set-file-attributes-sftp.md","title":"Set File Attributes","bundle":null,"doc_type":null,"release":"australia","body":"\n# Set File Attributes\n\nSets common file attributes, such as timestamps, size, permissions, and UID/GID, for a file or directory on an SFTP server.\n\nA good practice is to use the Get File List command to return a list of files and their attributes first. Then, after you have moved the files from a source host to a target host, use the Set File Attributes command to set the source file attributes on the target file.\n\n## Fields\n\n<table id=\"table_ifc_ckk_kjb\"><thead><tr><th>\n\nField\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td colspan=\"2\">\n\nConnections\n\n</td></tr><tr><td>\n\nSource Connection\n\n</td><td>\n\nType of connection to use to connect to the source SFTP server.-   **Define Connection Inline**: Define connection information within the action step.\n-   **Use Connection Alias**: Define connection information using the Connection Alias table. Using an alias eliminates the need to configure multiple credentials and connection information profiles when using an action in multiple environments. Likewise, if the connection information changes, you don't need to update your custom action.\n\n To learn more about connections and credentials, see [Introduction to credentials, connections, and aliases](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/platform-security/credentials-connections-alias.md).\n\n</td></tr><tr><td>\n\nSource Connection Alias\n\n</td><td>\n\nConnection &amp; Credential alias record that the system uses to run the action step. Users with the flow\\_designer or admin role can create or select an associated Connection record. Using an alias eliminates the need to configure multiple credentials and connection information profiles when using an action in multiple environments. Likewise, if the connection information changes, you don't need to update your custom action. To learn more about connections and credentials, see [credentials, connections, and aliases](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/platform-security/credentials-connections-alias.md). The credential value is displayed as a Password \\(2 Way Encrypted\\) data pill on the data panel. This field is available when **Use Connection Alias** is selected from the Source Connection list.\n\n</td></tr><tr><td>\n\nSource Credential alias\n\n</td><td>\n\nCredential alias that the system uses to run the action step. Users with the flow\\_designer or admin role can create or select an associated Connection record. Using an alias eliminates the need to configure multiple credentials when using an action in multiple environments. Likewise, if the credential information changes, you don't need to update your custom action. To learn more about connections and credentials, see [credentials, connections, and aliases](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/platform-security/credentials-connections-alias.md). The credential value is displayed as a Password \\(2 Way Encrypted\\) data pill on the data panel. This field is available when **Define Connection Inline** is selected from the Source Connection list.**Note:** The SFTP step requires a credential record that supports either SSH private key credentials or SSH credentials. This step does not support Windows credentials where the **Use MID Server service account** option is selected.\n\n</td></tr><tr><td>\n\nHost\n\n</td><td>\n\nName or IP address of the SFTP server that contains the file you wish to remove.\n\n</td></tr><tr><td>\n\nPort\n\n</td><td>\n\nPort number to communicate with the server.\n\n</td></tr><tr><td>\n\nMID Selection\n\n</td><td>\n\nOption to select a specific MID Server or MID Cluster. Choose any one of the following options. -   **Auto-Select MID Server**: Your ServiceNow instance selects the MID Server without manual input.\n-   **Specific MID Server**: Your ServiceNow instance uses MID Server that you specify.\n-   **Specific MID Cluster**: Your ServiceNow instance uses the MID Cluster that you specify.\n\nA MID Cluster is a group of MID Servers that enables your ServiceNow instance to handle multiple integrations, and improve integration speed. For more information, see [Configure a MID Server cluster](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/servicenow-platform/t_ConfigureAMIDServerCluster.md).\n\n\n This field is available when **Define Connection Inline** is selected from the Source Connection list.\n\n</td></tr><tr><td>\n\nMID Application\n\n</td><td>\n\nOption to use a MID Server to run the SFTP step. This field is available when **Define Connection Inline** is selected from the Source Connection list and **Auto-Select MID Server** is selected from the MID Selection list.\n\n</td></tr><tr><td>\n\nCapabilities\n\n</td><td>\n\nCapability of the MID Server. Select **SSH**. This field is available when **Define Connection Inline** is selected from the Source Connection list and **Auto-Select MID Server** is selected from the MID Selection list.\n\n</td></tr><tr><td>\n\nMID Server\n\n</td><td>\n\nData pill of the required MID Server. This field is available when **Define Connection Inline** is selected from the Source Connection list and **Specific MID Server** is selected from the MID Selection list.\n\n</td></tr><tr><td>\n\nMID Cluster\n\n</td><td>\n\nData pill for the MID Cluster you want to use. This field is available when **Define Connection Inline** is selected from the Source Connection list, and **Specific MID Cluster** is selected from the MID Selection list.\n\n</td></tr><tr><td colspan=\"2\">\n\nCommand Details\n\n</td></tr><tr><td>\n\nSource Path\n\n</td><td>\n\nPath of the directory that contains the files you wish to remove.\n\n</td></tr><tr><td>\n\nUser ID\n\n</td><td>\n\nUser ID attribute to apply to the file or directory. The UID and GUID variables must be set together as a pair.\n\n</td></tr><tr><td>\n\nGroup ID\n\n</td><td>\n\nGroup ID attribute to apply to the file or directory. The UID and GUID variables must be set together as a pair.\n\n</td></tr><tr><td>\n\nPermissions \\(chmod\\)\n\n</td><td>\n\nFile or directory permissions to set for the user and group specified. This value must be specified in Octal notation only. For example, `755`.**Note:** The permissions number is an internal value returned by the Get File List command.\n\n</td></tr><tr><td>\n\nModified Timestamp \\(epoch\\)\n\n</td><td>\n\nOverride the timestamp when the file or directory was last modified.**Note:**\n\n-   Timestamp must be in epoch format.\n-   Access and modification timestamps must be set together as a pair.\n\n</td></tr><tr><td>\n\nAccessed Timestamp \\(epoch\\)\n\n</td><td>\n\nOverride the timestamp when the file or directory was last accessed.**Note:**\n\n-   Timestamp must be in epoch format.\n-   Access and modification timestamps must be set together as a pair.\n\n</td></tr><tr><td colspan=\"2\">\n\nRetry Policy\n\n</td></tr><tr><td>\n\nEnable Retry Policy\n\n</td><td>\n\nOption to enable the retry policy. For more information, see [Retry policy](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/build-workflows/workflow-studio/retry-policy.md).\n\n</td></tr><tr><td>\n\nOverride Default Policy for Alias\n\n</td><td>\n\nOption to override the default retry policy. This option is not applicable when **Define Connection Inline** is selected from the Connection list.\n\n</td></tr><tr><td>\n\nRetry Policy\n\n</td><td>\n\nDefault retry policy associated with **Connection Alias**. If **Override Default Policy for Alias** is selected, you can override the default retry policy and select another existing retry policy based on your requirement.\n\n</td></tr></tbody>\n</table>## Action error evaluation\n\n-   **If this step fails**\n\n    Data type: **Choice**\n\n    Option to continue running the next step or go to error evaluation. To use the step status code or message for a custom action error condition, see [Action error evaluation](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/build-workflows/workflow-studio/action-error-evaluation.md).\n\n\n**Parent Topic:**[SFTP step](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/build-workflows/workflow-studio/sftp-step.md)\n\n"}}