> ## Documentation Index
> Fetch the complete documentation index at: https://fuse-docs.swovo.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Defining Custom Actions

> Fuse allows developers to define custom bulk actions.

Developers can add bulk action functionality to the importer using Custom Actions. See the preview below for an example.

## addCustomAction

The `addCustomAction` function accepts an object as an argument with the following properties:

* `action_type` (String) - required: Currently must be set to "record".
* `name` (String) - required: A succinct description of the action.
* `handler` (Function) - required: A function that takes a `record` and manipulates it when the action is performed.

<Note>
  Custom actions are hidden in the UI until you select a row in the spreadsheet.
</Note>

## Example Code

```javascript theme={null}
const importer = new FuseImporter();

importer.getSessionToken = ... // see https://fuse-docs.flatirons.com/getting-started/sessions


importer.addCustomAction({
  actionType: "record",
  name: "Generate ID",
  handler: (record) => {
    record['id'] = Math.random();
    return record;
  }
});

importer.show();
```

## Preview

What a custom action called "Generate ID" would look like.

<img src="https://mintcdn.com/flatirons/18QE1i72HLvymxXY/images/custom-actions.png?fit=max&auto=format&n=18QE1i72HLvymxXY&q=85&s=c40100201511023e6194cc6b5c45947b" alt="Custom Actions Preview" width="3002" height="1718" data-path="images/custom-actions.png" />
