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:

 

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

 

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

Whenever you want to add a new row to a table you might find yourself wanting to validate the data before you send it off. This action is perfect for such use-cases.

 

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 BindingBinding - A method for passing dynamic values into queries, form fields, elements, and more!.

The Reset to default value type will change the value of the chosen field to its Default ValueDefault Value - The value a form field will have on initial load..

On Change

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

Specifically, pickers will update on selection, whereas key input fields will update on loss of focus.

In addition, there is a convenient BindingBinding - A method for passing dynamic values into queries, form fields, elements, and more! {{ Field Value }} which represents the value of the trigger form field.


Did this page help you?