Often you want to run automations or update data when a user presses a button. This is what actions are for. To define your actions, click the Define actions, a drawer will appear where you can add, or remove actions tied to this component.

Available actions

The list of available actions are listed below:

Save Row

Saving a row can mean two things, updating or adding a new row. Depending on what you want to do you will have to structure your code differently.

If you're adding a new row the easiest way is to add a Form component. Once you've set that up correctly you add a button to it and select the Save Row action. You then select your form and the table you want to save it to. That's it. An example of how it might look is below.

Updating a row can be done in a number of different ways. If you have a structure containing a Data Provider and a Repeater, selecting the repeater as your Data Source will make it so you can correctly get the values from the specific row. To change a field you then take advantage of the add column button that is at the bottom. Click it, select the field you want to change, and type in the value you want to change it to (or use a binding). A descriptive image of this is shown below:

If you are not using a repeater, an alternative way to update a row is to add the _id column and provide a value that matches an existing id.
For example, you could be passing a task id in the URL:

Duplicate Row

Allows you to clone a row into any table with shared column names.
If you are performing this action from a row button click, then no _id needs to be provided.

Delete Row

This action is used to delete rows from your data source. It's used much in the same way that you would when updating a row.

Navigate To

Use this action if you want to go to another page. This can be used to navigate back to a dashboard after adding a new row to a table among other things.
For example: Navigation on row button click

Close Screen Modal

If the current screen has been opened as a Modal, then close it.

Execute Query

The queries that you have created in the backend can be triggered via this action.

Trigger Automation

If you have set up an automation you can use this to trigger it.

Validate Form

To be used in conjunction with Form validation.

Log Out

If you want to log a user out, you can use this action

Clear Form

An action that is used when you want to clear a form.

Export Data

Allows users to export all of the selected rows of a table to either a CSV or JSON file.

Refresh Data Provider

Refetch the latest data from the specified provider.

Update Field Value

Will update the value of a form field with a literal value or Binding.

The Reset to default value type will change the value of the chosen field to its Default Value.

On Change

Form fields have the ability to trigger an action on change of their value.

Specifically, Pickers will update on selection, whereas keyboard Input fields will update on loss of focus.

In addition, there is a convenient Binding {{ Field Value }} which represents the value of the trigger form field.

Video tutorial

Did this page help you?