Format JavaScript objects

When writing JavaScript objects to the scratchpad, maintain the standard JSON format and do not attempt to express the objects as strings.

Expressing a JavaScript object as a string is unnecessary and requires additional parsing. The workflow scratchpad can serialize and deserialize data to and from any JavaScript primitive, array, or object. This example shows objects stored incorrectly as strings.

var user1 = "{ 'name':'Joe', age:12 }";
var user2 = "{ 'name':'Mary', age:42 }";
workflow.scratchpad.users = [user1, user2];

This second example shows the recommended way to store JavaScript objects.

var user1 = { 'name':'Joe', age:12 };
var user2 = { 'name':'Mary', age:42 };
workflow.scratchpad.users = [user1, user2];