Action control is a special control through which you can trigger specific events like - Navigating to a screen, sending email etc. These events will trigger when a user clicks on the Action control. To add an Action control, go to the app builder page; in the Controls tab, go to FORMS, then go to BUTTON section and click or drag and drop Action control. Once you add the Action control on the app, click on the 'A' icon to open Action formula box (as highlighted in the below image)

On the Action formula box, you can write the Action formula as your need.
Note - You can add multiple actions on an Action control which will execute/trigger in the order in which they are written in the Action control.

Currently, DronaHQ Studio supports the following action event in Actions formula -

NAVIGATE()

Navigate to specific screen in application, it requires 3 parameters:
NAVIGATE("Screen URL",Transition)

  1. Screen URL to navigate. A screen url can be taken from the Screen's Info. Go to SCREENS tab, and click on the desired screen. When you click on the screen, the screen will open along with its info on the right side of the page. In the INFO section, Navigation URL (as shown in the below image) is the screen URL that you should put in the NAVIGATE formula to navigate when use clicks on Action control.

2. Transition animation: This indicates how the screen transition when user clicks on Action control. It accepts any one value out of the following:
1: Slide to Right
2: Slide to Left
3: Slide to Bottom
4: Slide to Top

E.g. NAVIGATE("screen-1",1) (As shown in the below image)

CALL()

It is used to call specified number. This will open system Dialer Application with the number populated on the dailer. It requires a valid phone number.

E.g. CALL("+91-22-6758-1740") as shown in the below image-

When a use tries to click an Action control with CALL() action, a dailer modal will be displayed on the app on the DronaHQ Unified App as shown in the below image - 

SMS()

SMS() is used to send a text message. This will open the system messaging application with the message & number populated on the compose message screen. It requires 2 parameters: 1) Mobile Number & 2) Text message

E.g. SMS("+919226758174","This is Studio Action Event SMS") as shown in the below image - 

The default message application on the device will be opened with the number and text message displayed on the message editor when user tries to click on Action control with SMS() action, as shown in the below image - 

EMAIL()

It is used to send Email to specific Email ID. This Will open the phone's Email App to send Email with the corresponding message and email id populated on the compose email screen. This formula requires 3 parameters: 1)Recipient's Email ID, 2) Subject & 3) Email Body

E.g. EMAIL("qa@studio.com","Welcome to DronaHQ Studio","Hi, Welcome to DronaHQ Studio Low Code App Development tool.") as shown in the below image - 

When user tries to click an Action control with EMAIL() action, default email application will be opened and an draft mail will populate with email address, subject, body as mentioned in the EMAIL() as shown in the below image - 

CALLAPI()

It is used to call the registered api. The apis that are added in the microapp can be used as a parameter to this formula. Please refer the article - How to Add APIs in your App and then use Action button to call the API using CALLAPI() formula.

E.g. CALLAPI("GetUsers")

EXITAPP()

This action will exit from the current microapp. In other words, if the EXITAPP() action is used in an Action control and when user clicks on the control, the microapp will exit and user will be taken to DronaHQ Unified App home screen.

Did this answer your question?