setComponentOptions

Description

Allows users to set a value to a component.

Input / Parameter

Output

Note: The component will be updated to show the value that has been set to it.

Object

Example

In this example, we have a button (in blue) that when clicked will populate the dropdown of the component.

Steps

  1. First, we drag a button and a dropdown input onto the Editor.

  2. Select the button and under the 'Actions' tab, drag the App.setComponentOptions into the flow for the button.

  3. Under the inspector for this function, select the component whose dropdown you would be populating, which in this example is Dropdown411, and then fill in valueField and displayField

  4. Add the function Conversion.toList in the 'data' parameter using the 'function' parameter type.

  1. Then add Conversion.toObject inside each parameter of the Conversion.toList function. The object must follow valueField and displayField that has been set

Result

  1. Save and preview your app.

  2. Now when you click the button, it will set the dropdown of Dropdown411.

See also:

Last updated