Transform Map - only update active = true users list in user table

rambabu1
Giga Expert

Hi All,

below is my requirement.

I have total 100 users list. i want to import those users list in sys_user table using importsets.

In those 100 records 30 records are active = false. i don't want to include those 30 records in user table. hoow can i restrict that?

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@rambabu 

You can ignore the rows from the excel if the target field is inactive

Use Transform map onBefore script for this

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

    // Add your code here

if(target.active == false){

ignore = true;

}

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

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

View solution in original post

4 REPLIES 4

Inactive_Us2019
Giga Expert

Hey,

 

You could use OnBefore script

 if(!target.active){

 ignore = true;

}

 

If my reply has helped in any way, kindly mark it correct/helpful. Thanks!

Ankur Bawiskar
Tera Patron
Tera Patron

@rambabu 

You can ignore the rows from the excel if the target field is inactive

Use Transform map onBefore script for this

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

    // Add your code here

if(target.active == false){

ignore = true;

}

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

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

@rambabu 

Hope you are doing good.

Did my reply answer your question?

If so, please mark appropriate response as correct & helpful so that the question will appear as resolved for others who may have a similar question in the future.

Thanks!
Ankur

 

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

@Chenab Khanna 

Hope you are doing good.

Did my reply answer your question?

If so, please mark appropriate response as correct & helpful so that the question will appear as resolved for others who may have a similar question in the future.

Thanks!
Ankur

 

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader