Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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

Image AddedImage Removed
Figure 1: JSON Tool Properties - Configure JSON Tool

NameDescription
JSON URLURL to be called.


Image Removed
Figure 2: JSON Tool Properties - Store to Form

NameDescription
Form Target form to store data to.
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.

NameDescription
Field Name Form field ID
JSON Object Name JSON property name

Image AddedImage Removed
Figure 3: JSON Tool Properties - Store to Workflow Variable

NameDescription
Workflow Variable Mapping
NameDescription
Workflow VariableWorkflow Variable Name.
JSON Object Name JSON property name.

Image Added

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/workflowapps/packagepublished/listuserviews

Sample JSON Result: ? 

Code Block
langjavascript
{
    "dataapps": [{
        "id": "crm",
        "name": "CRM",
        "userviews": [{
            "id": "crm_userview_sales",
            "description": "",
            "packageNamename": "CRM: Sales Force Automation",
            "packageIdurl": "/jw/web/userview/crm/crm_userview_sales",
            "version": 1
        }],
        {"version": 1
    }, {
        "packageNameid": "Dashboardhr_expense",
        "name": "HR Expenses Claim App",
        "packageIduserviews": "dashboard"[{
        },
     "id": "hr_expense_userview",
            {"description": "",
            "packageNamename": "HR Expenses ExpenseClaim App for Admin",
            "packageIdurl": "/jw/web/userview/hr_expense/hr_expense_userview",
            "version": 2
        }],
        "version": 2
    }, {
        "id": "isr",
        "packageNamename": "ISR",Internal Service Request",
        "userviews": [{
            "packageIdid": "isr",
         }   "description": "",
         {   "name": "Internal Service Request App",
            "packageNameurl": "JSON App"/jw/web/userview/isr/isr",
            "version": 1
        }],
        "version": 1
   "packageId }, {
        "id": "jsonAppims",
        "name": "Simple }Invoicing",
        "userviews": [{
            "packageNameid": "ims",
            "name": "LeaveSimple AppInvoicing",
            "packageIdurl": "leaveApp"/jw/web/userview/ims/ims",
            "version": 1
        }],
        "version": 1
    }]
}

Image AddedImage Removed
Figure 4: Sample JSON data saved in Joget form data table

You can download the test app from APP_json1-1-20151026181405.jwa.