Question on LDAP

Mani60
Tera Contributor

Hi All,
I have imported user via ldap and transformed map I have mapped name ,email , department and company field those are working fine but here I want to update cmn_department table and core_company table so what should I do in transformed map to get auto update company and departments in user table automatically once the user company and department gets changes in azure AD , can anybody help me on this.

 

Please find the below snapshot,

Mani60_0-1699613425448.png

Mani60_1-1699613474038.png

 

Thanks,

 

1 REPLY 1

Anand Kumar P
Giga Patron
Giga Patron

Hi @Mani60 ,

You have to gliderecord the company and department table depends on source table and set in target table

 var department = source.department;
    var company = source.company;
    if (department) {
        var departmentGR = new GlideRecord('cmn_department');
        if (departmentGR.get('name', department)) {
            target.department = departmentGR.getUniqueValue();
        } 
    if (company) {
        var companyGR = new GlideRecord('core_company');
        if (companyGR.get('name', company)) {
            target.company = companyGR.getUniqueValue();
        } 

Please mark it as helpful and solution proposed if it serves your purpose.

Thanks,

Anand