What are Action Links?
Action Links are a special type of link that you can add to details, tables, lists, maps or calendar views. Action Links allow a Live App user to trigger specific actions behind the scenes with the click of a link on the view. Action Links can be found in any of the specified views, under the "Links" (or "Special" tab if you are using a details view) when editing the view.
Here is an example of what an Action Link looks like in a table view.
With Action Links you can perform the following actions:
- update this record
- update connected records
- insert a connected record
- send a custom email
Here are some common examples of what you can do with Action Links:
- Change the status of a record to "completed" and set the time that action was taken
- Update a record's assignment to the logged-in user
- Approve a record and send an email of this approval
Manage Action Links
Add Action Links
Before you can start using action links, you will need to add one to your app. To start, navigate to the "Pages" section of your Knack Builder, and select a details, table, list, map or calendar view and open the view editor.
Each view has a slight variation on how to add the action link. Details views (lists, maps and calendar views use this details view setup) and Table views are outlined below.
Adding Action Links to Detail Views
Once the view editor is open, select "Details" from the left side menu, and then select the “Special” tab. Click on "Trigger an action" to add a new link to your view. That link will allow you to set up an action and the Live App users to trigger the action.
Note: for List views these steps follow the exact language. For Map views, adding an action link will fall under the "List Details" section in the left side menu and for Calendar views adding an action link will fall under the "Event Details" section in the left side menu.
Once this link has been added, click on the edit pencil to open and customize this action link and define:
- the trigger criteria and the link; what is the link text and when do you want to show it?
- the action; what happens after the action is triggered?
- and the outcome; what happens after the action is complete?
Each of these components of the action link are outlined below.
Adding Action Links to Table Views
Once the view editor is open, select "Columns" from the left side menu, and then select the “Links” tab. Click on "Trigger an action" to add a new column that will allow you as the Builder to set up this action and the Live App users to trigger the action.
Once this column has been added, click on the edit pencil to open and customize this action link and define:
- the trigger criteria and the link; what is the link text and when do you want to show it?
- the action; what happens after the action is triggered?
- and the outcome; what happens after the action is complete?
Each of these components of the action link are outlined below.
Edit Action Links
To edit an existing action link, open the view editor and select the pencil icon on the action link in the preview.
Delete Action Links
To delete an action link, open the view editor and select the trash can icon on the action link in the view preview.
Action Link Settings
Trigger Criteria and Link
What is the link text and when do you want to show it?
"Trigger Criteria and Link" is the first component of an action link. This section is covers what the link text is and when you want to show it.
This defines the criteria for when the action is actually triggered after the link is clicked. When the link is clicked and all the criteria are met, the action will run.
By default the rule is set to run for every action link click, however, you can add criteria based on one or more specific record values.
Note: if you add multiple conditions, all conditions must be met in order for the action to be performed.
Actions
What happens after the action is triggered?
"Actions" is the second component in an action link. This section covers what happens after the action is triggered.
This defines what Knack will do behind the scenes once the action link has been clicked. Here you can choose to update this record, update a connected record, insert a connected record, or send a custom email.
Action: Update this record
This option will update the record this link is added to. This is useful for setting status or workflow fields upon click. You can also assign logged-in users so you can track who triggered this action.
Examples
-
Set up an "Assign to me" link that sets an Assigned Date to the current date, changes a Status field to "assigned" and set the assignee to the logged-in user
Action: Update connected records
This option will update connected records for the record this link is added to.
Example
- On a "confirm order" action link, when the status of an order is "confirmed", update the status field on the connected line items object to "confirmed" as well
Action: Insert a connected record
This option will insert a connected record to the record this link is added to. Your record's object must be connected to at least one other object for this option to be available. This option is great for adding history, version, and archived records based on the action link click.
Example
- Upon clicking an "archive" action link, which sets the status field on a record to "archived", insert a new connected record of the same object with all of the same data, where the connection is called Record history entry. This way, you can track each change to the parent record with a separate record.
Action: Send a custom email
This option will send an email for the record this link is added to. You can use record values for custom recipients, subjects, and messages. Click here to learn more about sending emails in Knack.
Example
- Using values from the Purchase Order record, this action link will notify the purchasing department which Purchase Order record's status has been set to "needs approval."
Values
What will an Action Link update?
The "Values" section of action links allow you to choose which fields are updated. Here you can add multiple value settings by selecting the green “+” button, or remove the settings by selecting the red “-” button.
Values can be set to:
-
A connected value: choose a field from a record connected to the form record
-
A custom value: enter a value manually
-
To the logged-in User (for user connection fields on pages which require a login)
-
To the current date (for date fields only)
- To the user's current location (for address fields only when the user is logged in)
Outcome
What happens after the action is complete?
"Outcome" is the third component in an action link. This section concerns what happens after the action is complete.
Outcomes determine what happens after an action link is successfully triggered. This is often a crucial piece of setting up workflow, as you can redirect a user from one page to another or show a particular message.
Options here include:
- Show a confirmation message
- Redirect to an existing page
- Redirect to the parent page
- Redirect to another website's URL
- Redirect to a new child page
These follow all the of the same setup and options as submit rules, with the exception that the confirmation messages with action links show up as notifications in the upper right-hand corner of the Live App.
Notes & Troubleshooting
General Notes
- Use caution when using the 'update connected records" option and deciding where to offer this for users in your app. This allows for updates to be made to multiple connected records at once, rather than single records.
- Only one action link is allowed per table cell. If multiple options are required for a record, multiple action links will need to be added.