Skip to Content
1
May 11, 2020 at 11:53 AM

SAC Scripting: Defining/Using JSON objects in functions

197 Views

Hello,

I was wondering how to work with JSON objects and how to pass them around in functions. I don't see Object as a data type for functions and variables. I know that in pure JS, JSON.parse() and JSON.stringify() are used to convert a string to a JSON and a JSON to String respectively. Therefore you can use a string as an input/return type and just parse the JSON object when you need to work with it. How can I achieve this in a function inside an Analytical Application. I tried looking up the API reference and this handbook without success. I need an object that will hold exchange rates w.r.t Euro like so: {"USD": "1.073", "CAD":"1.515"} and I would like to store this object in a variable (maybe as a string) and manipulate the parsed object.

Thanks,

Dimitar