Populate Controls Using REST Calls

Dynamically populate controls such as drop-down select, check list, radio button, table, and repeatable section controls with data using REST connectors.

  1. Drag and drop a drop-down select, a check list, a radio button, a table, or a repeatable section control onto the canvas to populate it with data using a REST call.
  2. Select the control and optionally, on the General tab in the Properties pane, edit the name, binding, label, and other fields.
  3. For a drop-down select, check list, or radio button control, in the Options Source field, select Connector and then configure the fields under the Options Source field to define the values based on a REST call. For a repeatable section or table control, select the Use Data From Connector field and configure the fields under this field.
    1. Connector: Select a REST connector from the defined list of connectors for the application.
      A REST connector lets you fetch data and perform tasks based on that data. See Add a REST Connector.
    2. Resource: Select a resource from which data should be fetched.
    3. Operation: Specify an operation to call.
      An operation indicates the task you want to perform. For example, a user may use an operation to fetch all the countries or to fetch a list of states based on a country code.
  4. Based on the call, the system will display a list of required parameters (payload values) and a response below the Options Source field or the Use Data From Connector field.
    1. Payload values: Specify the information to pass to the REST connector (parameters). You can specify query, header, or template parameters.
      If you selected Text, enter the parameter information. Or, if you selected Control value, select a control value from the available options.

      Note:

      Text parameters are secure and remain on the server.
    2. Response: Define how the response will be mapped to the control properties:
      • Options List: Define the mapping by specifying an attribute list from the response that contains the items to display as the options in the control.

      • If the list is a simple type of list such as a list of strings or numbers, then no label and value mappings are needed. The value of the item in the list will be used as both the label and the value of the option.

        If the list consists of complex elements, then you need to specify a mapping using the Label Binding and Value Binding fields to identify the label and value.

      Note:

      • For a table control, define how the response will be mapped to each column in the table. For a repeatable section, define which property from the response will be mapped to which control inside the repeatable section.

      • If the connector data is an array of elements, you can map a particular array item to a Response field by entering the corresponding array index, for example, response[0].RestResponse[1].result.

  5. You may also use the Skip Upon Load property to determine when the connector data loads into the control.
    • Deselect the checkbox (default state) to allow connector data to be populated into the control when the form loads.
    • Select the checkbox to prevent connector data being populated into the control when the form loads. When you use this option, you must explicitly execute a connector refresh for the data to load into the control.
  6. Optionally, in the Events field, configure the events for the control. See Configure Events.
Test the dynamic fetching of data by testing the application. And, verify if the mappings you defined work correctly as expected.