JSON not working in new Server- Urgent

We migrated a workflow to a server running the same OL Connect Workflow version. The old server executes scripts under JScript 5.8 and typeof(JSON) returns object. The new server executes scripts under Engine 11.0 and typeof(JSON) returns undefined. Is there a supported configuration, component, or Windows dependency required to enable JSON support in Workflow scripts?

In case the issue is with the Run Script plugin; see if changing the Language from JScript to Enhanced JScript works.

P.S. Should it not be something like typeof obj (without parentheses) instead?

I tried using EnhancedJScript, but it did not resolve the issue.

Our workflow scripts use JSON.stringify() and JSON.parse() in several places. Any script step that references JSON fails with the following error:
image

This script produces the exact same result when it is run in JScript and in Enhanced JScript:

var myObj = {action:"Hello",target:"World!"};
Watch.log("typeof(JSON) : " + typeof(JSON) + " ==> " + JSON.stringify(myObj),2);

@Marten: the syntax without parentheses is more common, but using parentheses is also accepted (and actually required when evaluating the type of an expression).

1 Like

@krishna, can you let us know please what version of OL Connect Workflow you have installed*, and on what operating system (OS) OL Connect Workflow is installed?

*An option to check this is to launch the Workflow Configuration and see what version is shown on the splash screen. Another option is to check the version in the bottom left corner of the application once it is loaded.