# Using Coded automation in Low-Code workflow

> In this tutorial, you can learn how to incorporate a coded automation called `CodedResetAssetValue.cs` into a low-code workflow. The `CodedResetAssetValue.cs` automation performs the following steps:

In this tutorial, you can learn how to incorporate a coded automation called `CodedResetAssetValue.cs` into a low-code workflow. The `CodedResetAssetValue.cs` automation performs the following steps:

1. Retrieves the current value of a specific asset from Orchestrator.
2. Compares the retrieved asset value with the input value provided as an argument.
3. If the previous asset value does not match the input value, it updates the asset value in Orchestrator.
4. Logs messages that indicate the status of the asset value, whether it was updated or remained unchanged.

To use a coded automation inside a low-code workflow, first create the coded workflow, then invoke it in the low-code workflow using the **Invoke Workflow File** activity. Perform the following steps to incorporate a coded automation within a low-code workflow:

1. Create a new coded workflow. For this example, name it `CodedResetAssetValue`.
   1. Give the following return arguments to the `Execute` method to indicate if the asset value was changed and to provide the asset value: `(bool assetValueWasChanged, string assetValue)`
   2. For the `Execute` method, add the following input parameters: `assetName (string)` and `assetValue (string)`.

      ```
      public (bool assetValueWasChanged, string assetValue) Execute(string assetName, string assetValue)
      ```

   3. Use the `GetAsset` coded automation API to retrieve the current value of the specified asset using the `assetName` parameter.
   4. Store the previous asset value in the `previousAssetValue` variable .

      ```
      var previousAssetValue = system.GetAsset(assetName).ToString();
      ```

   5. Compare the previous asset value with the input asset value using the `Equals` method.
   6. If the values are equal, return `(false, assetValue)` to indicate that the asset value was not changed.
   7. If the values are different, use the `SetAsset` coded automation API to update the asset value to the input `assetValue`.
   8. Return `(true, previousAssetValue)` to indicate that the asset value was changed, along with the previous asset value.

   ```
   if (previousAssetValue.Equals(assetValue))
         {
           return (assetValueWasChanged: false, assetValue: assetValue);
         }
         else
         {
           system.SetAsset(assetValue, assetName);
           return (assetValueWasChanged: true, assetValue: previousAssetValue);
         }
   ```

2. Create a low-code workflow. For this example, name it `WorkflowUsingCodedAutomation`.
3. Add an **Assign** activity and assign a value to the `assetValue` variable.
4. Add an **Invoke Workflow File** activity and invoke the `CodedResetAssetValue.cs` coded automation. Add the required arguments.

      :::note
      For Windows projects: In the **Invoke Workflow File** activity, select **Browse for File** and change the file extensions you're browsing for, from **Workflow Files** (`*.xaml`, `*.uiwf`) to **All Files (\*.\*)**. This allows you to view all files, including `.cs`.
      :::

      ![docs image](https://dev-assets.cms.uipath.com/assets/images/studio/2024-10-docs-image-329276-d5e9119a.webp)

5. Add an **If** activity, and log messages for the scenarios where an asset value remains unchanged, and for the scenario where an asset value is updated.

   ![docs image](https://dev-assets.cms.uipath.com/assets/images/studio/2024-10-docs-image-329272-9aecd9b2.webp)
