1. Home
  2. Tutorials
  3. Creating your App UX
  4. Toggle Element Visibility

Toggle Element Visibility

You can use the Set Value Action in Dropsource to show and hide Elements when Events occur in your app. With the Element you want to show/hide added to the page:

  1. Decide when you want the Element to appear/disappear and select the relevant Event. For example, to toggle visibility of an Element when the user taps a Button, select the Button and open Properties > Events, clicking Add/Manage for the Tapped Event.
  2. Add an If Else Action and click Edit.
    • In the first input, select the Element you’re toggling and choose the Hidden property. select element hidden
    • In the second input, select a Static Input Boolean value of True . Save the Action. select boolean true
  3. Under the True Event, click the plus plus button, add a Set Value Action, and click Edit. In this case the Element is already hidden, so the Action should show it.
    • In the first input, select the Element you’re toggling and choose the Hidden property.
    • In the second input, select a Static Input Boolean value of False. Save the Action. show element
  4. Under the False Event, add another Set Value Action and click Edit.
    • In the first input, select the Hidden property of the Element being toggled.
    • In the second input, select a Static Input Boolean value of True. Save the Action.

If you want to toggle interaction on and off in input Elements you can do so, for example using a Switch Element and the Set Value Action. You can also set display properties for certain Elements such as Buttons using their Selected State in the Properties tab. Your Set Value Actions can optionally reference dynamic data from API responses.

Was this article helpful to you? Yes No

How can we help?