We're reclaiming inactive PDIs to keep them available for active builders. Learn what's changing, who's affected, and how to protect your work. Read More

Transform onBefore ignore record

Tom Siegel
Kilo Guru

I have built a custom Transformation Map for Microsoft Intune Computers. Some of the records coming over have no userPrincipalName and I want to ignore them. After doing some reading on the forum I decided to use an onBefore script to ignore these records. The logic seemed pretty straight forward so I implemented the below:

(function runTransformScript(source, map, log, target /*undefined onStart*/ ) {

// Add your code here
if (source.u_userprincipalname == '') {
ignore = true;

}

})(source, map, log, target);

I ran the import along with the Transform and yet there are records that have no userPrincipalName being updated by the import.

What am I missing?

 

Thanks,

 

Tom

1 ACCEPTED SOLUTION

Voona Rohila
Tera Patron

Hi @Tom Siegel 

Try this

 

(function runTransformScript(source, map, log, target /*undefined onStart*/ ) {

// Add your code here
if (source.u_userprincipalname.toString() == '') // check if field name is proper or not.
 {
ignore = true;
}

})(source, map, log, target);

 

 


Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
5x ServiceNow MVP

View solution in original post

2 REPLIES 2

Voona Rohila
Tera Patron

Hi @Tom Siegel 

Try this

 

(function runTransformScript(source, map, log, target /*undefined onStart*/ ) {

// Add your code here
if (source.u_userprincipalname.toString() == '') // check if field name is proper or not.
 {
ignore = true;
}

})(source, map, log, target);

 

 


Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
5x ServiceNow MVP

Rohila - Thanks for the help that makes more sense

 

Tom