IntegrationHub OnBefore script not working

DylanBlumenberg
Tera Contributor

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);

 

 

16 REPLIES 16

pavani_paluri
Giga Guru

Hi @DylanBlumenberg ,

 

You are assigning to source.u_po_number. Is that be target field.

 

Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Pavani P

Hi @pavani_paluri, I think I need clarification on how these scripts affect the data. In an OnBefore script, is the target a staging table or would the target be the final table that the data is being imported to, in this case, ast_contract?