- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-26-2017 05:31 AM
Hi,
We're on Helsinki...
I just finished watching a video from ChuckT. from 2014 regarding the use of a 'global' variable within a Script Include. In my case I would like something very similar to assist in a Transform Map.
To borrow from the video -- is it possible to have, say --->
OnBefore:
(function runTransformScript(source, map, log, target /*undefined onStart*/ ) {
//my Global variable??
if (MyVAR == 'undefined')
MyVAR = 'some_original_thing';
if (source.some_source_field != '')
MyVAR = source.some_source_field;
else
source.some_source_field = MyVar;
//I am trying to 'recall' a value from a 'previous' row for subsequent rows that do not have that some_source_field set
})(source, map, log, target);
in the video it was stated that a variable not declared with 'var' will be 'global' --- does this work for Transform Maps?
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-26-2017 05:35 AM
Hi Anthony,
Yes, you can do this with a transform script. Declare it in an onStart script and it's available to other scripts within the transform process.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-26-2017 05:34 AM
Trade Secret
In such cases i just use session variable. Just make sure you clear it/ kill it after use.
-Anurag
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-26-2017 05:35 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-26-2017 05:35 AM
Hi Anthony,
Yes, you can do this with a transform script. Declare it in an onStart script and it's available to other scripts within the transform process.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-26-2017 06:33 AM
Thanks, Chuck... and Anurag ...
See you at K17 !!!!