Example: Data Connector Provides Options in a Select List Control
Follow an example that uses a Data Connector to get a list of worldwide universities that become the options in a Select List control within a Screen.
Overview
Intended audience: Process designers, Web designers, graphic designers, software developers, coding engineers
Tags: Data Connector; Select List control; higher education; Screen design
Note that after creating this Data Connector, it may be used for any ProcessMaker Platform asset that can use a Data Connector. It is not limited to being used with a Select List control.
Click the video below to watch a demonstration of this example.
Intended audience: Process designers, Web designers, graphic designers, software developers, coding engineers
Viewing time: 9 minutes; contains narration
Note: The video demonstrates how to configure the Data Connector using obsolete settings. The written form of this example documents how to configure the Data Connector using current settings.
This example contains the following procedures in this order:
Create the Data Connector
Click the Designer option from the top menu. The Processes page displays.
In the Name setting, enter the name of the Data Connector. This example uses the name
Get List of Major Universities in the World
.In the Description setting, enter a description of this Data Connector. This example uses the description:
This ProcessMaker Platform Data Connector gets a list of major universities around the world in JSON structure.
From the Authentication Type drop-down menu, select the No Auth option. This example uses this option because the host does not require authentication from its publicly accessible API. Note that the video of this example uses Basic Auth, which is not necessary for this example since the data source is publicly accessible.
Click Save. The Data Connector is created and the Resources tab displays.
In the Description setting, enter a description of this Resource. This example uses the following description:
This Resource gets a JSON list of worldwide universities.
From the Method drop-down menu, select the GET option. The GET method reads data.
Notice which element in each JSON object within the API endpoint response contains the name of the university. Look at the first JSON object that is the list of universities:
{
"domains": [
"marywood.edu"
],
"country": "United States",
"web_pages": [
],
"name": "Marywood University",
"state-province": null,
"alpha_two_code": "PA"
},
The
name
element contains the name of each university in this JSON object. Make note of the element's name that contains relevant data from a data source, as the ProcessMaker Platform asset requires this element name when configuring which data that asset requires from the Data Connector's Resource response. In this example, the Screen containing the Select List control is the ProcessMaker Platform asset.Click Save to save the Resource. The Data Connector is configured for this example.
Configure the Select List Control
Most settings for the Select List control are outside the scope of this example. The default settings can be used for required settings, and optional settings do not need to be configured.
From the Data Source drop-down menu, select the Data Connector option. Settings in the Data Source panel display to configure which Data Connector and Resource this control uses as its data source.
In the Options Variable setting, keep the default
response
value. This setting represents the name of the JSON object that contains the response from the Data Connector's Resource. In this example,response
will contain the JSON array of universities.From the Type of Value Returned drop-down menu, select the Single Value option because this example requires only one element value from the JSON response.
In the Value setting, enter the JSON element name that contains the value to use as the Select List option in each JSON object of the Resource response. In this example, enter
name
because thename
JSON element contains the name of each university in each JSON object.In the Content setting enter
name
for the same reason as above.From the Data Connector drop-down menu, select the Data Connector the Select List control uses to access the data source. For this example, select Get List of Major Universities in the World.
From the End Point drop-down menu, select which Resource in the selected Data Connector to access the data source. For this example, select list universities.
Create the Process Model
Your user account or group membership must have the following permissions to create a new Process unless your user account has the Make this user a Super Admin setting selected:
Processes: Create Processes
Processes: View Processes
Start a Request for the Example Process
The example is ready to demonstrate. To demonstrate this example, start a Request of this Process.
Related Topics
Last updated