Skip to main content
Kinetic Community

Utility Json Parse

This handler parses a specified path out of a JSON string into XML.

Downloads

By downloading this file, you acknowledge that you agree to our Terms of Service

utility_json_parse_v1.zip

Detailed Description

Below are some examples of JSON input strings and the corresponding XML output
generated by this handler.
 
JSON & Parameters:
{
  'parameters' => {
    'path' => "requesters/phone",
    'unique' => 'Yes',
    'json' => '
{"requesters":[
{"action":"delete",
"fname":"Allen Allbrook",
"lname":"Allen Allbrook",
"phone":"612-555-1212",
"startdate":"Start Date here"
,"title":"Title here",
"manager":"Manager here",
"dept":"Dept here",
"location":"Location here",
"corpid":"Allen",
"sysa":"SYSA here"
},
{"action":"delete",
"fname":"Kathy Villani",
"lname":"Kathy Villani",
"phone":"301-555-1212",
"startdate":"Start Date here",
"title":"Title here",
"manager":"Manager here",
"dept":"Dept here",
"location":"Location here",
"corpid":"Kathy",
"sysa":"SYSA here"
}
]}'
  }
}
 
Parsed Path's XML:
<items>
<item>612-555-1212</item>
<item>301-555-1212</item>
</items>
 
JSON & Parameters:
{
  'parameters' => {
    'path' => "requesters/action",
    'unique' => 'No',
    'json' => '
{"requesters":[
{"action":"delete",
"fname":"Allen Allbrook",
"lname":"Allen Allbrook",
"phone":"612-555-1212",
"startdate":"Start Date here"
,"title":"Title here",
"manager":"Manager here",
"dept":"Dept here",
"location":"Location here",
"corpid":"Allen",
"sysa":"SYSA here"
},
{"action":"delete",
"fname":"Kathy Villani",
"lname":"Kathy Villani",
"phone":"301-555-1212",
"startdate":"Start Date here",
"title":"Title here",
"manager":"Manager here",
"dept":"Dept here",
"location":"Location here",
"corpid":"Kathy",
"sysa":"SYSA here"
}
]}'
  }
}
 
Parsed Path's XML:
<items>
<item>delete</item>
<item>delete</item>
</items>
 
JSON & Parameters:
{
  'parameters' => {
    'path' => "requesters/action",
    'unique' => 'Yes',
    'json' => '
{"requesters":[
{"action":"delete",
"fname":"Allen Allbrook",
"lname":"Allen Allbrook",
"phone":"612-555-1212",
"startdate":"Start Date here"
,"title":"Title here",
"manager":"Manager here",
"dept":"Dept here",
"location":"Location here",
"corpid":"Allen",
"sysa":"SYSA here"
},
{"action":"delete",
"fname":"Kathy Villani",
"lname":"Kathy Villani",
"phone":"301-555-1212",
"startdate":"Start Date here",
"title":"Title here",
"manager":"Manager here",
"dept":"Dept here",
"location":"Location here",
"corpid":"Kathy",
"sysa":"SYSA here"
}
]}'
  }
}
 
Parsed Path's XML:
<items>
<item>delete</item>
</items>

Parameters

Name Description
JSON The JSON structure to be parsed
Path The Path to the data that should be returned
Unique If set to Yes, the list of items with contain no duplicates

Sample Configuration

Parameter Example Configuration
JSON <%=@answers['Employees']%>
Path requesters/phone
Unique Yes

Results

Name Description
Items An XML String that was parsed from the given JSON.

Change Log

Version Date Description
1 2011-08-18 Initial Version