# SetCredential

> Enables you to update the value of an indicated credential asset, that is already available in Orchestrator, be it a global or a Per Robot asset. [Click here for details on assets](https://docs.uipath.com/orchestrator/standalone/2023.4/user-guide/about-assets).

Enables you to update the value of an indicated credential asset, that is already available in Orchestrator, be it a global or a Per Robot asset. [Click here for details on assets](https://docs.uipath.com/orchestrator/standalone/2023.4/user-guide/about-assets).

Note that to execute this method, [the Robot role](https://docs.uipath.com/orchestrator/standalone/2023.4/user-guide/default-roles#robot-role) needs to have **Edit** permissions on assets. When this method is run, it uses the same authentication context as the Robot which executes it, inheriting its permissions.

## Definition

**Namespace:** UiPath.Activities.System.API

**Assembly:** UiPath.System.Activities.Api (in UiPath.System.Activities.Api.dll)

## Overloads

|  |  |
| --- | --- |
| `SetCredential(String, String, String)` | Update the value of an indicated credential asset. |
| `SetCredential(String, String, String, String)` | Update the value of an indicated credential asset, at a specified Orchestrator folder path. |
| `SetCredential(String, String, String, String, Int32)` | Update the value of an indicated credential asset, at a specified Orchestrator folder path, and with `TimeoutMS` configured. |

## `SetCredential(String, String, String, String, Int32)`

Update the value of an indicated credential asset, at a specified Orchestrator folder path, and with `TimeoutMS` configured.

```
void SetCredential(
    string userName,
    string password,
    string credentialName
)
```

`userName` [String](https://learn.microsoft.com/dotnet/api/system.string) : The new username for the indicated credential asset.

`password` [String](https://learn.microsoft.com/dotnet/api/system.string) : The new password for the indicated credential asset.

`credentialName` [String](https://learn.microsoft.com/dotnet/api/system.string) : The name of the credential asset to be updated. The name has to be exactly the same as the one in Orchestrator, and the same capitalization has to be used.

## `SetCredential(String, String, String, String)`

Update the value of an indicated credential asset, at a specified Orchestrator folder path.

```
void SetCredential(
    string userName,
    string password,
    string credentialName,
    string folderPath
)
```

`userName` [String](https://learn.microsoft.com/dotnet/api/system.string) : The new username for the indicated credential asset.

`password` [String](https://learn.microsoft.com/dotnet/api/system.string) : The new password for the indicated credential asset.

`credentialName` [String](https://learn.microsoft.com/dotnet/api/system.string) : The name of the credential asset to be updated. The name has to be exactly the same as the one in Orchestrator, and the same capitalization has to be used.

`folderPath` [String](https://learn.microsoft.com/dotnet/api/system.string) : [The path of the folder](https://docs.uipath.com/orchestrator/docs/folders) where the credential asset is located, if different from the folder where the process is running. This field only supports string values, with `/` as the separator to indicate subfolders. For example `"Finance/Accounts Payable"`.

## `SetCredential(String, String, String, String, Int32)`

Update the value of an indicated credential asset, at a specified Orchestrator folder path, and with `TimeoutMS` configured.

```
void SetCredential(
    string userName,
    string password,
    string credentialName,
    string folderPath,
    int timeoutMS
)
```

`userName` [String](https://learn.microsoft.com/dotnet/api/system.string) : The new username for the indicated credential asset.

`password` [String](https://learn.microsoft.com/dotnet/api/system.string) : The new password for the indicated credential asset.

`credentialName` [String](https://learn.microsoft.com/dotnet/api/system.string) : The name of the credential asset to be updated. The name has to be exactly the same as the one in Orchestrator, and the same capitalization has to be used.

`folderPath` [String](https://learn.microsoft.com/dotnet/api/system.string) : [The path of the folder](https://docs.uipath.com/orchestrator/docs/folders) where the credential asset is located, if different from the folder where the process is running. This field only supports string values, with `/` as the separator to indicate subfolders. For example `"Finance/Accounts Payable"`.

`timeoutMS` [Int32](https://learn.microsoft.com/dotnet/api/system.int32) : Specifies the amount of time (in milliseconds) to wait for the activity to run before an error is thrown. The default value is 30000 milliseconds (30 seconds).
