Is there a way to cache or create object variables for use in mapping functions?

0 votes
asked Aug 24, 2017 by myles-k-3121 (150 points)
I'm creating an HTTP Listener based channel with xml/json input. I'm trying to parse the json in the source content node into an object that can be used across multiple mapping functions without reparsing in each function.

I have seen examples where the json structure is traversed, and copied into messageCache variables. I am trying to find an object based approach, in which the json is parsed once, and that allows the more natural object based dot notation.

1 Answer

+2 votes
Best answer

Create a script variable that can be set by your payload result and then referenced by any other functions.

create script variable

Set the script variable

Set the script variable

Check the value of the script variable

answered Aug 24, 2017 by michael-h-5027 (13,630 points)
selected Aug 24, 2017 by sam-s-1510