The JSON Tool in a process enables one to issue a JSON web service call, and to save the returned data into Joget's form data and/or into the process's workflow variable.

| Name | Description | Screen (Click to view) |
|---|---|---|
| JSON URL | URL to be called. |
Figure 1: Configure JSON Tool |
| Call Type | Select the call type:
| |
POST Method (Call type = POST) | Select the post method:
| |
POST Parameters (Call type = POST) | When POST Method is set to "POST Parameters", these parameters will be sent as a UrlEncodedFormEntity. When POST Method is set to "POST Parameters as JSON Payload", these parameters will be sent as a StringEntity in a form of an escaped JSON string. | |
| Custom JSON Payload | Write your own JSON to be the payload. It will be sent as a StringEntity. This option is available only when "Custom JSON Payload" in selected. | |
| Request Headers | Add name(s) and value(s) to the request header. | |
| No Response Expected | Check if no response is expected, so that even if there is a response, this tool will simply ignore it. Using this option will also disable "store to form" and "store to workflow variable" properties. | |
| Debug Mode | Show relevant debug entries in the server log for debugging purposes. |
| Name | Description | Screen (Click to view) | |||||
|---|---|---|---|---|---|---|---|
| Form | Select target form to store data to. |
Figure 2: Store to Form | |||||
| Base JSON Object Name for Multirow Data | Name of the object that contains an array to be based on. | ||||||
| Field Mapping | Mapping with JSON data with Form fields.
|
| Name | Description | Screen (Click to view) | ||||||
|---|---|---|---|---|---|---|---|---|
| Workflow Variable Mapping |
|
Figure 3: Store to Workflow Variable |
In figure 2 and 3, one will need to specify on how to treat the returned data. The returned data may be saved as form data or/add to be saved into process's workflow variable. The example used in this article shows on how one can store multi-row data into a form data table.
Sample JSON API: http://localhost:8080/jw/web/json/apps/published/userviews
(Note: Enter asterisk " * " into the "API Domain Whitelist (Separated by ';')" field in General Settings to allow API calls).
Sample JSON Result:
{
"apps": [{
"id": "crm",
"name": "CRM",
"userviews": [{
"id": "crm_userview_sales",
"description": "",
"name": "CRM: Sales Force Automation",
"url": "/jw/web/userview/crm/crm_userview_sales",
"version": 1
}],
"version": 1
}, {
"id": "hr_expense",
"name": "HR Expenses Claim App",
"userviews": [{
"id": "hr_expense_userview",
"description": "",
"name": "HR Expenses Claim App for Admin",
"url": "/jw/web/userview/hr_expense/hr_expense_userview",
"version": 2
}],
"version": 2
}, {
"id": "isr",
"name": "Internal Service Request",
"userviews": [{
"id": "isr",
"description": "",
"name": "Internal Service Request App",
"url": "/jw/web/userview/isr/isr",
"version": 1
}],
"version": 1
}, {
"id": "ims",
"name": "Simple Invoicing",
"userviews": [{
"id": "ims",
"name": "Simple Invoicing",
"url": "/jw/web/userview/ims/ims",
"version": 1
}],
"version": 1
}]
} |

Figure 4: Sample JSON data saved in Joget form data table
.