1. Home
  2. Documentation
  3. Using Dropsource
  4. Defining Functionality
  5. Specifying App Behavior

Specifying App Behavior

With Dropsource Actions, you can achieve the user experience you need by adding Actions for a range of functionality types, including native functions that leverage other apps and data on the user device. You can also add logic and control flow to your app with nested Actions that execute when conditions are met.

Managing Events

To add an Action, click Add for your chosen Element, page, or API Event (or Manage if the Event already has Actions added to it). Click the plus plus button and choose from the list.

actions list

ⓘ Note

You can add multiple Actions to the same Event, and they will execute in the order listed – use the arrow buttons to reorder them. Any Action with the terminal icon terminal must be last in the list for an Event.

ⓘ Note

Certain Actions cannot simulate in the browser – you will see these listed with the no simulate icon. To test these Actions you’ll need to run your app on a real device.

With an Action open, click Edit (if the Action requires editing), making a selection for any fields listed, and Save.

go to page action

Some Actions return data – in this case you will see a Returns section.

action output

You can access any data returned by an Action in the Action Data container for other Actions in the same Event scope (including nested Actions).

action data

You can also access information about the Event, via the Event Data container.

file picker action

ⓘ Note

If you decide not to add an Action, use the delete delete button or it will remain attached to your Event.

Selecting Action Inputs

Most of the Actions you use in Dropsource expose parameters you can set. For example, the Set Value action allows you to assign a values from an input source in the app to any of its Elements or variables.

set element value

The available input selections are tailored to the Action and relevant data type in each case. Certain Actions include the ability to dynamically add inputs – such as the alerts on both platforms, in which you can add buttons and Dropsource will automatically create nested Events to respond to taps on each one.

alert dynamic events

Your app can carry out basic arithmetic calculations using the Calculate Math Expression Action. Your calculation can reference input values added statically or from the sources in your app (including variables, user input, and API data). Add a Variable to include in your calculation, choosing an input source for its value, then reference it in the Expression field as part of your formula.

math action

You can access the returned number value in other Actions added to the same Event in your app.

math result

ⓘ Note

On Android, the math Action will return a double number type, which you can cast to another type such as integer by saving it to an integer variable. On iOS the action returns an NSNumber type, allowing you to select various types from the Action Data returned, including int, double, float, and string.

The Build a String Action uses a similar pattern to interpolate text strings by referencing sources in your app. Add Variables for any values you want to build into the string, and reference them in the Template field enclosed in double curly braces and along with any string literals you need.

string action

You can access the returned string via the Action Data and build it into subsequent processing in your app.

string result

The math and string building Actions will dynamically highlight and validate your input as you type it into the Template / Expression fields.

Adding Conditional Actions

Some Actions include nested Events of their own, allowing you to build control flow into your app. The If Else Action carries out a logic test on two input values, which can come from various sources in your project such as Elements and variables. You can then add Actions to execute when a true or false result is returned.

conditional actions

If your app contains an API response with an array in it, you can carry out Actions on each item in the array using the Iterate through Array Action.

ⓘ Note

If you don’t see the functionality you need, you may be able to add it to your project using a Plugin.

Was this article helpful to you? Yes No

How can we help?