# Modal Submit

> Triggers when a user submits a modal.

- ID: `modal_submit`
- Type: Interaction trigger
- Category: [Interactions](https://inventor.bot/docs/reference/triggers/interactions.md)

- Interaction trigger: blocks that respond to interactions (replies, modals, ...) can be used in its flows.

**Options**

| Name | Required | Description | Value |
| --- | --- | --- | --- |
| `custom_id` | yes | Modal custom ID to listen for. Supports `*` wildcard matching (e.g. `report_*`). | e.g. `"report_modal"` |

**Outputs**

| Name | Description | Value |
| --- | --- | --- |
| `custom_id` | Custom ID of the submitted modal. | e.g. `"report_modal"` |
| `wildcard_value` | If the Custom ID input uses a single `*` wildcard, this is the matched portion of the submitted modal Custom ID. | e.g. `"123"` |
| `user_id` | ID of the user who submitted the modal. | e.g. `"123456789012345678"` |
| `username` | Username of the user who submitted the modal. | e.g. `"johndoe"` |
| `user_avatar` | Avatar URL of the user who submitted the modal. | e.g. `"https://cdn.discordapp.com/avatars/123/abc.png"` |
| `channel_id` | Channel where the modal was submitted. | e.g. `"123456789012345678"` |
| `server_id` | Server where the modal was submitted. | e.g. `"123456789012345678"` |
| `application_id` | ID of the application that received this interaction. | e.g. `"123456789012345678"` |
| `interaction_id` | Unique interaction ID for this modal submit. | e.g. `"123456789012345678"` |
| `interaction_token` | Token for this interaction, useful for webhook follow-up/edit operations. | e.g. `"aW50ZXJhY3Rpb25fdG9rZW4"` |
| `app_permissions` | Permissions the bot/application had in the interaction channel, as a Discord bitfield string. | e.g. `"274877990912"` |
| `user_locale` | Discord locale of the user who submitted the modal. | e.g. `"en-US"` |
| `server_locale` | Preferred locale of the server where the modal was submitted, when available. | e.g. `"en-US"` |
| `interaction_context` | Where the interaction was used (`server`, `bot_dm`, or `private_channel`). | e.g. `"server"` |
| `message_id` | Message ID if the modal originated from a message component. | e.g. `"123456789012345678"` |
| `values_json` | JSON object of submitted modal values keyed by component custom_id. | e.g. `"{\"bug_reason\":\"something broke\",\"severity\":\"high\"}"` |
| `field_1` | Value of the first submitted modal field, in the order shown to the user. | e.g. `"something broke"` |
| `field_2` | Value of the second submitted modal field, in the order shown to the user. | e.g. `"high"` |
| `field_3` | Value of the third submitted modal field, in the order shown to the user. | e.g. `"extra details"` |
| `field_4` | Value of the fourth submitted modal field, in the order shown to the user. | e.g. `"follow-up info"` |
| `field_5` | Value of the fifth submitted modal field, in the order shown to the user. | e.g. `"final note"` |
| `component_count` | Number of submitted input/select components extracted from the modal. | e.g. `"2"` |

**Example**

```go
var trigger = modal_submit(Args{custom_id: "report_modal"})

func main() {
	send_text_message(Args{
		channel_id:      trigger.channel_id,
		message_content: "Custom ID: " + trigger.custom_id,
	})
}
```