IntegrationHub OnBefore script not working

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2025 08:32 AM
Hi all,
I am using IntegrationHub to take an Excel file and transform the data to the Contract, Asset, and Assets Covered tables.
On the integration, I have a simple OnBefore script where if the Asset Type column on the Excel document is "Workstations" or "Notebooks", set the PO Number to "94904", but it does not work. I've looked at documentation for similar tasks and tried various iterations of this script but can't find a reason why this wouldn't work.
Why might this be?
(function onBefore(source, target, importLog) {
if(source.u_asset_type == "Workstations" || source.u_asset_type == "Notebooks")
source.u_po_number = '94904';
})(source, target, importLog);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2025 10:34 AM
Hi @Yousaf, I have more info from your suggestions.
1. I'm finding that the IntegrationHub import uses the table global_ihub_import_e86a72c73b1a2650e7aa2f2eb3e45a7a, which does not have any transform maps associated with it.
2. In the Asset Type column on the Excel file, there are no extra whitespaces. In the script, the values of Workstations and Notebooks have been copied right from the Excel file, so no case sensitivity issues either.
I added some logs to the script (below) and they are evaluating true, which leads me to believe that the issue is with the target.
3. The PO Number field name on the ast_contract table is po_number, so I updated the script target line to read "target.po_number = '94904';".
4. From what I can tell, the import is running as my account which has full admin.
(function onBefore(source, target, importLog) {
gs.log("Asset Type:" + source.u_asset_type);
if (source.u_asset_type == "Workstations" || source.u_asset_type == "Notebooks") {
target.po_number = '94904';
gs.log("Condition evaluated true");
}
else {
gs.log("Condition evaluated false");
}
})(source, target, importLog);
I tried the OnAfter script and also added logs to it. The condition is evaluating true again, but the records PO Number fields are still not updated.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2025 10:45 AM - edited 07-31-2025 03:10 AM
I believe you need to create transform map between staging and target table and use the script there in transforming stage.
Please try that
***Mark Correct or Helpful if it helps.***

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2025 01:31 PM
It appears the TEMP ETL Entities aren't tied to a table.
I attempted to make a transform map between the source table and the target table and it wouldn't let me, with the following error.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2025 02:03 PM
Ouh this is robust transform......
Try this table (sys_rte_transformer) find your transformer Dell LAR....
And try adding your script before transforming stage
I am not able to try any of these since i am in a waitlist to get my PDI......
***Mark Correct or Helpful if it helps.***

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2025 02:32 PM
That table doesn't exist in my instance but on the Robust Import Set Transformer page, there's not a way to add a script.