# Lock File

> `UiPath.Box.Activities.File.LockFile`

`UiPath.Box.Activities.File.LockFile`

The **Lock File** activity uses the Box [Update file](https://developer.box.com/reference/put-files-id/) API to lock a specified file (**File ID**) with optional parameters including the lock expiration (**Expires At**) and file download status (**Prevent Download**).

After locking the file, the activity outputs a `Boolean` value to report the current file lock status (**File Lock**).

## How it works

The following steps and message sequence diagram is an example of how the activity works from design time (i.e., the activity dependencies and input/output properties) to run time.

1. Complete the [Setup](https://docs.uipath.com/activities/other/latest/legacy-integrations/box-setup) steps.
2. Add the [Box Scope](https://docs.uipath.com/activities/other/latest/legacy-integrations/box-scope) activity to your project.
3. Add an activity or run an external process that outputs a `File.Id` value (e.g., [Upload File](https://docs.uipath.com/activities/other/latest/legacy-integrations/box-upload-file), [Search for Content](https://docs.uipath.com/activities/other/latest/legacy-integrations/box-search-for-content), etc.).
4. Add the **Lock File** activity inside the **Box Scope** activity.
5. Enter a value for the [Input](https://docs.uipath.com/activities/other/latest/legacy-integrations/box-lock-file#lock-file) property.
6. Create and enter a `Boolean` variable for the [Output](https://docs.uipath.com/activities/other/latest/legacy-integrations/box-lock-file#lock-file) property.
   * Your input property values are sent in the [Update file](https://developer.box.com/reference/put-files-id/) API operation request.
   * The operation returns the `Boolean` value to your output property variable.

     ![docs image](https://dev-assets.cms.uipath.com/assets/images/activities/legacy-integrations-docs-image-181933-7940dc9a-1367f1c4.webp)

## Properties

### Common

* **ContinueOnError** - Specifies if you want the activity to continue running when an error is thrown. This field supports only `Boolean` values.
* **DisplayName** - The display name of the activity. This field supports only `Strings` or `String` variables.

### Input

* **File ID** - The ID of the file that you want to lock. This field supports only `Strings` or `String` variables. To get the **File ID** value, add an activity or run an external process that outputs a `File.Id` object (e.g., [Upload File](https://docs.uipath.com/activities/other/latest/legacy-integrations/box-upload-file), [Search for Content](https://docs.uipath.com/activities/other/latest/legacy-integrations/box-search-for-content), etc.).

### Misc

* **Private** - If selected, the values of variables and arguments are no longer logged at Verbose level.

### Options

* **Expires At** - The date when the lock expires. Enter a `DateTime` or `DateTime` variable. Default is to never expire.
* **Prevent Download** - If selected, the file can't be downloaded.

### Output

* **File Lock** - A `Boolean` value that reports the current file lock status. The `Boolean` values are:
  + *True* - file is locked.
  + *False* - file is unlocked.
