> For the complete documentation index, see [llms.txt](https://codemash.gitbook.io/codemash/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://codemash.gitbook.io/codemash/cloud/files/triggers/edit.md).

# Edit a trigger

Change a files trigger — its event, folder, action, recipients and template tokens.

**Where:** Files → Triggers → click a trigger · `/projects/<project>/files/triggers/<triggerId>/edit`

## Before you start

* The trigger exists — see [Create a trigger](/codemash/cloud/files/triggers/new.md).

## Steps

1. In **File Triggers**, click the name, for example `Tell the catalog team`. The form opens as **Edit Trigger** with the trigger id (`trg_1DvMA9Nn07AFouYobkEHUA`, with a copy button) and the **Actions** menu. Every saved value is loaded: the event, the folder (`catalog`), the action, the recipients, the template and the tokens.

   <figure><img src="https://712692422-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHy372bqsaex2cqS3ikhL%2Fuploads%2Fgit-blob-17e3c1a51822ea3722bfda4f1aae02f24edaf410%2Ftriggers-edit-1.png?alt=media" alt="Edit Trigger with the id trg_1DvMA9Nn07AFouYobkEHUA, the Actions button, When uploaded picked and In this folder catalog"><figcaption><p>Edit Trigger.</p></figcaption></figure>
2. Change what you need — the same fields as in [Create a trigger](/codemash/cloud/files/triggers/new.md):

   | Part                                 | What you change                                                   | Example                                         |
   | ------------------------------------ | ----------------------------------------------------------------- | ----------------------------------------------- |
   | If this                              | The event.                                                        | **When uploaded**                               |
   | In this folder                       | The folder; empty means every file.                               | `catalog`                                       |
   | ... then                             | The action and its recipients.                                    | **Email Addresses**, `catalog-team@example.com` |
   | Template Details                     | The template and the language.                                    | `New catalog file`                              |
   | Template Tokens                      | The value of each token: type it, or pick it with the tag button. | `Recipient.FirstName` = `Catalog team`          |
   | Order, Name the trigger, Description | The trigger's own fields.                                         | Order `1`                                       |

   <figure><img src="https://712692422-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHy372bqsaex2cqS3ikhL%2Fuploads%2Fgit-blob-d1345129474d0e366a3ef6865f0258b582353367%2Ftriggers-edit-2.png?alt=media" alt="Template Details and Template Tokens of the saved trigger: template New catalog file, tokens Recipient.FirstName Catalog team, Email.SignatureId emlsgn_…, Email.FooterId emlftr_…, Project.Name, Project.Url"><figcaption><p>The saved template and tokens.</p></figcaption></figure>
3. Press **Save**.

## Result

Cloud goes back to **File Triggers**. The next uploaded or deleted file uses the new values.

## Change or remove it later

* **Disable / Enable** — [Enable or disable a trigger](/codemash/cloud/files/triggers/enable.md).
* **Delete** — [Delete a trigger](/codemash/cloud/files/triggers/delete.md).

## Do it from code

```ts
const { trigger } = await norbix.hub.files.getFilesTrigger({ id: 'trg_1DvMA9Nn07AFouYobkEHUA' });
console.log(trigger.name, trigger.when, trigger.folder, trigger.thenAction.deliverySettings.recipients);
// Tell the catalog team OnFileUploaded catalog [ 'catalog-team@example.com' ]
```

```sh
norbix hub files trigger get trg_1DvMA9Nn07AFouYobkEHUA
```

To change a trigger from code, send the whole trigger again to **Save Files Trigger** with its `triggerId` — see [Create a trigger](/codemash/cloud/files/triggers/new.md#do-it-from-code). The client setup is on the [Files page](/codemash/cloud/files.md#use-it-from-code). API: [Get Files Trigger](/codemash/api-reference/files/triggers/get-files-trigger.md) · [Save Files Trigger](/codemash/api-reference/files/triggers/save-files-trigger.md)
