A useful way to think about apps is through the way users interact with them. Two very basic levels of interaction are viewing & editing data.
But very often, apps need to be able to perform Actions.
Open Link and Show Form Screen are examples of Simple Actions, but Glide also has an Action Editor where you can join Actions together into more complex workflows. We call these Custom Actions.
Types of Actions
There are many different Actions in Glide. Mostly, they fall into four categories.
Data Actions use or change data. These include things like
Navigation Actions show or move users to different screens. For example:
Communication Actions trigger things like emails, text messages, and phone calls and Advanced actions are for more technical users.
Generally, Actions are the same in Apps & Pages, but you'll find some actions only live in certain places.
There are various places where you can add Actions. Again, these differ between Apps and Pages, but there are some general themes.
Some Components have Actions, and some do not. If a Component has the option for an Action, you’ll see it in the component’s configuration.
The default Action for clicking on a list item is to view that item’s Details Screen. This is such a normal behavior, you might not have thought of it as an Action before.
But you can change this to a number of other Actions. For example, you could have;
- A list of contacts that when tapped, triggers the Dial Phone Number Action.
- A list of inventory items that when tapped, decrements a number.
This table is a good example. It shows a lot of information but is really compact.
- There’s search and filtering
- At the top of the List, we have our main Actions and a dropdown menu for even more.
- Each item has its own Buttons, to edit or contact the landlord
- Each item also has its own dropdown menu.
On Submit Actions
Another type of Action is the On-submit Action.
After users add/edit or submit Forms — you have the option to add Actions that trigger on submit.
Where can you add actions?
Here is a basic list of the places you can add Actions. This is likely to change over time so may not be comprehensive.
- Action text
- Rich text
- On submit
- Title bar
- Item click
- Collection item
- Action text
- Rich text
- On submit
Components like Button and Image allow you to add Actions to them. When these Components are tapped, these Actions trigger different functionalities in your App.
You can also enable Actions on list items. By default, list items have the action Show Details Screen which takes the user to the Details Layoutfor that row. However, you can change this Action and have lists of items that perform other Actions when they are tapped.
In the image below you can see an inline list with the default View Details action in place. However, after we change the action to Open Link then each list item opens a link instead.
Simple Actions can be joined together into Custom Actions.
Creating a custom action
To create a Custom Action, navigate to the Features tab of a Component or List Layout, and under the Action dropdown, click 'Create new action...'. This will open the Action Editor.
The first part of what makes the Custom Actions powerful is the ability to have sequences of different Actions be triggered – as opposed to just a Single Action.
To add new actions to the flow, hover just underneath an action and click the plus button.
To edit actions, click on the action.
To re-order actions, click and drag the action.
To delete actions, open the action, and click the trash icon.
You may only want a single sequence of actions to be triggered every time, but often you will want to create different scenarios where different actions happen, depending on conditions you set. Therefore, the second dimension in building custom actions is working with Conditions.
To add a condition to one of your sequences, click the plus icon at the top of a sequence.
Whatever conditions you set here will mean that the action sequence below will only run when your condition is met.
If the condition is not met, the action sequence won't run. However, conditions often need other scenarios to determine what will happen if the initial condition is not met.
To do this, we can add an 'Else' to our condition. With an else added, if the first condition in our action editor is not met, then the actions under the else section will be triggered.
You can also add many different conditions to your custom action by adding other conditions.