IntegrationHub - How to prevent a record from being inserted (ignore = true)

midjoule
Kilo Sage

Hello experts,

I've setup an ETL throught IntegrationHub and I'm wondering how I can ignore records with specific attributes.

The support documentation proposes this script, slightly enhanced to match our requirement (in yellow). However, it doesn't work:

 (function(batch, output) { 
                for (var i = 0; i < batch.length; i++) { 
                        var in0 = gs.nil(batch[i].input) ? '' : batch[i].input; 
                        output[i] = in0 + " modified by scriptā€;

//do not import if the value of the field attribute = 'ABC'
if (batch[i].attribute = 'ABC')
batch[i].ignore = true
} } })(batch, output);

How could I achieve this ? Is there any additional supporting documentation in regards to scripting within the IntegrationHub ?

 

1 ACCEPTED SOLUTION

Thank you Andrew for the proposal. Unfortunately it didn't resolve the issue. 

In fact, we managed it without using any script, which is good. In fact there is a condition builder which supports our requirement:

  1. Click the button Edit Class
  2. In our case, we want to exclude records were both LNX and @@@ vendor_monitor are set (value is not LNX and value is not @@@)
  3. As the else condition remains empty, the class is not set.

Here is the screenshot:

find_real_file.png

Even if we found the solution, I would still be interested to know more about the methods available in the batch and output variables, and especially on how to ignore a record by script. If anyone has a proposal, please write it here.

Best regards

View solution in original post

13 REPLIES 13

1. I'm wondering why the computer CI wouldn't be in the CMDB. 

2. In your data, is there a way to determine if the computer is in the CMDB or not ?

3. If not, I would suggest managing it through a "on Before insert" business rule on the Disk table: if there is no CI related to the disk, then abort the operation. Unfortunately, I'm don't see other option in the IntegrationHub ETL.

 

Yes, we have a ID, with that we can glide in table and check what's the class

Hi Taniya,

Is your issue resolved ? Should it be the case, could you please close it (mark as correct)? Otherwise, please explain where you are stuck.

Best regards

VaranAwesomenow
Mega Sage
You can implement this in 3 ways
1. Implement on before script
    gliderecordusing key field from source / target -> if found
        //status = 'SKIPPED';
        or
        //ignore = true;
2. Implement on after script
    On after can access target Object, so you can run a set query to check if its a valid record or not and do a delete.
3. Write a post import script on scheduled import that will do the delete