Transform map to exclude if targer company is different.

EricG2
Tera Expert

Due to our company's domain separation, i have many users that have multiple user accounts in active directory.

 

So, I've finally got our HR Department to send me a feed for all activate users and their HR information (where appropriate).

 

Due to some "business decisions" and missing AD attributes, I need use the LDAP import to bring some fields into my user table. (Email, SAM, AccountControl, etc).

 

In my transform map, I'm aware of how to exclude users by criteria in the import table.  AKA source.field ==""; ingnore - true.  etc.   I'm using Employee Number to coalesce  records, so i only get 1 user record.

 

I'm not real clear on what i should do to ignore the LDAP record if the users company doesn't match the user company.

So far i think this should work

if(source.u_userprincipalname == ""){
ignore = true;
}
if(action == "insert"){
        //Only want New Records from HR Feed
	ignore = true;
}

var usrComp = target.sys_id;

	if(usrComp=="guid1" || usrComp=="guid2"){
		update = true;
	}
}

Is this correct or is there a better way to approach this?

 

My current Environment:
I have 3 domains that LDAP pulls from.

There are 4 companies in our org.

   1. Company 1 has 5 name variations

   2. Company 2 has only 1

   3. Company 3 has 4 variations

   4.  Company 4 has only 3

 

I've been trying on and off for weeks to resolve this.

 

3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

@EricG2 

try this if you want to compare incoming company name against target company name

if (source.u_company_name == target.company.name.toString())
    ignore = true;

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

@EricG2 For the Company field map, choose reject option under choice action and set the Referenced value field name as "name" since company is a reference table to match the reference value. If the source value is not matched, import set record will be rejected. Please check this solution and mark as Helpful if its solves your problem.

 

Thanks,

Murugan J

@EricG2 

Hope you are doing good.

Did my reply answer your question?

If my response helped please mark it correct and close the thread so that it benefits future readers.

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