# Execute Callback

{% embed url="<https://www.youtube.com/watch?v=KzGksPj0jA4>" %}

Watch this on Youtube: <https://www.youtube.com/watch?v=KzGksPj0jA4>

The Execute Callback action allows you to call a custom callback defined in a component or a page params. This is especially useful when components expose actions to be executed by their parent or other external contexts.

> **Note:** To use this action, you must create a **page/component param** of type `Action`.

## Properties

| Property      | Type     | Required    | Description                                                                                                                                                                                               |
| ------------- | -------- | ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Action Name` | Dropdown | Yes         | Select the callback action defined in page/component params.                                                                                                                                              |
| `Arguments`   | Array    | Conditional | List of all required argument values for the selected action. When Action Name is selected, all internal parameters are automatically listed. Required if the action definition marks itself as required. |

## Use Cases

* **Component Communication**: Allow child components to trigger actions in parent contexts
* **Event Handling**: Execute custom logic when user interactions occur within components
* **Dynamic Actions**: Pass different callback behaviors to reusable components
* **Form Submissions**: Handle form data processing through configurable callbacks

## Default Behavior

By default:

| Behavior                | Description                                                                                 |
| ----------------------- | ------------------------------------------------------------------------------------------- |
| **Callback Resolution** | Action name is evaluated to find the target ActionFlow                                      |
| **Argument Passing**    | Arguments are made available in callback scope as `{{args.argumentName}}`                   |
| **Parameter Discovery** | All parameters (required and optional) are automatically listed after selecting Action Name |
| **Error Handling**      | Invalid action names or malformed ActionFlows throw errors                                  |
| **Execution Context**   | Callbacks run with access to the current scope context                                      |

## How to Use

<figure><img src="https://3626461507-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FbhApDTL7kHrXte2TTtjs%2Fuploads%2Fgit-blob-5d42e41a8fbb7701a2a427d33106912835fc68b2%2Fexecute_callback_action.png?alt=media" alt="Call External Method action configuration showing message name and payload fields"><figcaption><p>Call External Method action configuration in Digia Studio</p></figcaption></figure>

1. Create a page/component param of type `Action` to define the callback
2. Within the entity, add the **Execute Callback** action
3. Select the `Action Name` from the dropdown (shows available action params)
4. Once selected, all parameters for that action are automatically listed (required and optional)
5. Provide values for all required parameters and any optional parameters you want to override in the `Arguments` section

## Related Actions

* [Set State](https://docs.digia.tech/logic-and-interaction/actions/set-state) - Update state variables that may be used in callbacks
* [Execute External Method](https://docs.digia.tech/logic-and-interaction/actions/call-external-method) - Call external methods similar to callbacks
* [Fire Event](https://docs.digia.tech/logic-and-interaction/actions/fire-event) - Trigger events that can be handled by callbacks

***

*Asset Placeholder: Tutorial video demonstrating callback patterns and component communication in Digia Studio*
