Modal Submit

Triggers when a form/modal is submitted.

This trigger is based on Discord event InteractionCreate.

Inputs

Modal ID

The modal ID that you want to monitor for submissions.

Examples:

  • This trigger with the Modal ID of cool-modal would only trigger for modals with the ID of cool-modal
  • If the Modal ID was modal-* it would trigger for modal-yellow, modal-blue, and anything else that started with modal-

Outputs

Interaction ID

The interaction ID of the interaction.

Example: 123456789012345678

Interaction Token

The token of the interaction.

Example: abCdeF123gHiJkLmNoPqRsTuVwXyZ0123456789

Server ID

The server ID where the interaction is being run.

Example: 123456789012345678

Channel ID

The server ID where the interaction is being run.

Example: 123456789012345678

Executing User ID

The ID of the user that is running the command with the autocomplete option.

Example: 123456789012345678

Modal ID

The complete modal ID that was submitted.

Example: modal-yellow

Modal Field 1 Value

The value of the first field in the modal. Blank if there was no input.

Example: This is my answer for question one!

Modal Field 2 Value

The value of the second field in the modal. Blank if there was no input or if there are less than two modal fields.

Example: This is my answer for question two!

Modal Field 3 Value

The value of the third field in the modal. Blank if there was no input or if there are less than three modal fields.

Example: This is my answer for question three!

Modal Field 4 Value

The value of the fourth field in the modal. Blank if there was no input or if there are less than four modal fields.

Example: This is my answer for question four!

Modal Field 5 Value

The value of the fifth field in the modal. Blank if there was no input or if there are less than five modal fields.

Example: This is my answer for question five!

Context Type

The context type of the command.

Example: Server, DM

App Permissions

What permissions the bot application has in the context type.

Example: 2251799813685247

\

More Information

While different from dropdowns and modals, Modals have a unique and useful place in any Inventor's arsenal. They are useful for getting user feedback and allowing users to send messages (example for a /say command below)

Just like the Button Click trigger, Modal Submit supports prefixing meaning you can have multiple modals trigger the same flow but do different actions or use the flow to pass information through to another flow or process data from other flows in the modal submit flow.

Learn more about prefixing in the Button Click trigger

Example

This example will show you how to make a /say command but only the Modal Submit part. This example assumes a modal with one field and the ID of "`slash-say`"

The image above shows a "Modal Submit" trigger with an ID of "slash-say"

A modal on screen has the Field 1 set as "Enter text to repeat" prompting user to enter the text they want to bot to repeat

Upon submission of the modal, a Modal Submit event is triggered with Modal Field 1 Value being the text the user entered. You can take this data and directly place it into a Send or Edit Text Message block to send the user's message as the bot

The above image shows a "Send or Edit Message" block being used in the Modal Submit trigger

Now that you have the bot sending the user's message, all that's left is adding a reply and you're all set on your way to being a professional Inventor