This article provides a guide on how to utilize submit actions with form views in your Knack app.
This article covers the following topics:
What are submit actions?
Submit actions determine the destination to which the user will be directed after successfully submitting a form. This aspect is crucial for establishing workflow as it enables you to redirect users to various forms or any other accessible page within your app, or even to an external webpage if necessary.
Building Submit Actions
Submit actions can be accessed in the Settings menu of your form view. Select the "Actions & Rules" option under the Form Menu and then select "Submit Actions" on the following menu:
Adding a Submit Action
Each form will include one submit action by default. The default action cannot be removed.
You can add additional submit actions by clicking the "Add Rule" button below your default submit action:
Editing an Existing Submit Action & Changing the Order
The criteria for your submit action can be edited directly in the Submit Actions toolbox. You can also rearrange the order of your Submit Actions by selecting the icon on the top left corner of the rule and dragging it above or below your existing actions:
Copying a Submit Action
You can copy existing submit actions by selecting the copy icon in the top right corner of the action. A copy of the action will then appear below the original action.
Submit Actions
There are five available actions for your submit actions. The selected action determines what happens after your form is successfully submitted.
Show a Confirmation Message
After submission, the form will fade out, and the confirmation text will appear.
There are two additional options here:
-
Show a link to reload a form
-
Automatically reload the form
Here is an example of a form that shows a confirmation message and includes a link to reload the form after submission:
Redirect to an Existing Page
Upon successful submission, the user will be directed to a designated page within your app. Submit actions can redirect users to both parent/top-level pages and any child page that utilizes the same data source as the form.
Tip: To learn more about page types (child/parent pages), see our article here. Additionally, to learn more about the data source, see our article here.
Redirect to the Parent Page
Upon successful submission, the user will be automatically redirected to a parent page. This is particularly useful when your form adds a child record and you want to guide your users back to a page that displays all parent records.
Examples:
-
Upon a user creating a record, they will be directed back to the parent page where they can view a grid displaying all records for that table.
-
Upon form submission, redirect the user to a page with a rich text view which serves as a "thank you" page.
Redirect to Another Website's URL
Upon successful submission, users have the option to be redirected to any URL of their choosing. For instance, they can be directed to an existing "thank you" page as a way to conclude their workflow.
Redirect to a New Child Page
This option allows you to establish a new child page to direct the user to.
You have the flexibility to incorporate any desired views on this page, and it will seamlessly integrate with the form's record. This empowers users to swiftly add a new record and be instantly redirected to the relevant views of that specific record (such as a details view).
When Criteria
These are the conditions that trigger the submit action:
Multiple conditions can be added for each rule based on field values by clicking on the "+" button next to your action. It is important to note that if you add multiple conditions, all of them must be true for the submit rule to trigger.
Notes & Troubleshooting
-
If a submit action does not seem to be working, make sure you don’t have a second one with the same trigger, as the second one will take precedence over the first.
-
It is important to note that you cannot add "When" conditions to your first, or default submit action. The default submit action will be triggered for every form submission that does not match any other submit action.