Execute pre-import script - Data stream
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-15-2025 11:45 PM
I need to pass a single input parameter to a Data Stream using the Pre-Import Script.
I've already defined this input parameter in the Data Stream configuration.
I've also set up a Scheduled Import and linked it to a Data Source.
In the Data Source, I selected the type as Data Stream, and below that, I can see the input parameter fields where I can provide values dynamically.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-16-2025 01:50 AM - edited 10-16-2025 02:04 AM
Try without wrapper.
// Do NOT wrap this in a function: the script already has access to 'data_source' and 'import_set' by default.
(function(import_set_run, data_source) {
...
})(import_set_run, data_source);
Muhammad Iftikhar
If my response helped, please mark it as the accepted solution so others can benefit as well.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2026 04:02 AM
Try to use this
data_source.data_stream_action_inputs.<action input name>
instead of
data_source.setParameterValue
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Still does not work for me either.
As a workaround, I found where the Data Stream input value is stored in sys_variable_value and updated that record before running the Scheduled Import.
I tried the approaches mentioned here, including:
data_source.setParameterValue('<parmName>', value);data_source.data_stream_action_inputs.<action input name>
I also tested both with and without the wrapper:
(function(import_set_run, data_source) {
// ...
})(import_set_run, data_source);In my case, data_source.setParameterValue always returns undefined, and the value does not appear in the Data Stream execution runtime input.
The Pre-Import Script is definitely running, because my gs.info() logs are being generated. However, the Data Stream Action execution still shows the input runtime value as empty.
The only workaround that worked for me was updating the corresponding sys_variable_value record directly before executing the import.