How to transfer data across transform scripts
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2024 10:51 PM
I need to transfer data from onBefore transform script to onComplete transform script .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2024 11:03 PM
you can use the scratchpad to store temporary data during the onBefore transform script and access it in the onComplete transform script.
onBefore Transform Script:
// Set some data in the scratchpad during onBefore script
var myData = "This is some data";
current.scratchpad.myData = myData;
onComplete Transform Script:
// Access the data stored in the scratchpad during onComplete script
var myData = source.scratchpad.myData;
if (myData) {
// Do something with myData in the onComplete script
target.myField = "Transformed: " + myData;
}
Please mark my response helpful/correct if it helps you..Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2024 11:40 PM
getting undefined data.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2024 11:52 PM
@Shreya Nagar Na Please apply log on myData and check what are you getting in that on both scripts.Also can share your script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2024 11:04 PM
Hi @Shreya Nagar Na ,
There is nothing as such !
These are types of Transform scripts which executes during the process of data base operations,
See the below image to understand the time of execution of each scripts....
☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....