After you've created a data source, you must connect it to a form element. Many form elements support data source connections, such as drop downs, check boxes, grids, and more.
Connect a data source to a form element
- Go to Self Service > Forms. Select the Add Form button to create a new form, or select the Edit link for an existing form.
- On the form, add or edit the element to which you want to connect your data source. For this example, we'll add a Drop down element.
- If the form component supports data source connections, you will see a toggle for Use Data Source, as shown below.
- Turn on the Use Data Source toggle. In the Select Data Source drop down, select your desired data source. In this example, we will use the native HelloID Groups data source.
- The Value Field drop down represents the actual data value which will be submitted, whereas the Text Field drop down represents the label that will be shown to the end user. Make appropriate selections for both fields. For this example, we will select immutableId and name, respectively.
- Select the Update Field button when you are finished.
- Select the form's Save button.
- The example form now contains a drop down menu, populated with a list of groups in the HelloID environment:
Note that when the form is submitted as part of a self service request, you can access the data source object just like other form fields. See the Self Service Request Variable Reference for more information.
Pass input variables into a task or PowerShell data source
When you connect a task or PowerShell data source to a form element, you are given the option to pass arguments into its input variable(s). You can manually specify a value, or use a value from another element on the form by turning on the Use Value From Other Field toggle.
In the example below, we are using the latter option. The value of a text input element (Username Search) is being passed into the Username input key of a grid component's data source. In this case, the data source has been previously configured to take Username as an input variable. Its PowerShell script takes the value passed from the Username Search field and uses it to return a list of matching Active Directory users.
When the user enters a value in the Username Search field and submits the form, the results are displayed in the grid element itself: