The CreatorCon Call for Content is officially open! Get started here.

Coalesc script on Integration Hub Import

jonathangilbert
Kilo Sage

Hi All

 

I have just set up the Intune Spoke and I am now using the capability of the Integration Hub Import to automatically pull data from Intune on a schedule. I need to create a Transform script to stop the same device being added every time the schedule runs, as this works differently to a normal trnasform map where you just set the coalesc field to true on the incoming field .

 

jonathangilbert_0-1757687965610.png

Has anyone done this before

3 REPLIES 3

pavani_paluri
Giga Guru
Giga Guru

Hi @jonathangilbert 

 

You need to check if the device already exists before adding it. If it exists, update it. If not, add a new one.

You can do this by adding a small script in your import setup. Go to your Import Action, and find the section called Pre-processing Script. This script runs before the data is inserted into your table.

 

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

 

Thanks for the response, I know where to put the script, I was looking for assistance or an example of what it should look like

jonathangilbert
Kilo Sage

This is the script I have and it still creates duplicate entries when it is executed 

(function onBefore(source, target, importLog) {

if(source.serialNumber == target.serial_number){
ignore = true;
}

})(source, target, importLog);