Skip to content

Instantly share code, notes, and snippets.

@chelnak
Created September 15, 2015 15:38
Show Gist options
  • Select an option

  • Save chelnak/458f8816cf7092cf9a6e to your computer and use it in GitHub Desktop.

Select an option

Save chelnak/458f8816cf7092cf9a6e to your computer and use it in GitHub Desktop.
parseResponse.js action used in OTS package
//Input: string - Response in a JSON string
//Output: Any - Return the parsed object
//Parse the json string
var jsonResponse = JSON.parse(response);
//loop through and print out each key and value
for(var i in jsonResponse) {
System.log(i + ": " + jsonResponse[i]);
}
//return the object
return jsonResponse;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment