- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-18-2016 02:48 AM
Hi guys,
We are currently having an scheduled job running to import all of our shared mailboxes from a CSV on our mid server. When a new mailbox is created in O365, it automatically adds it in Servicenow.
The thing is, when a mailbox is deleted in O365, it still exists in ServiceNow. So i think i should create a transform map script to set the records to "not active" when the record is not available in the import set.
Does anyone has a solution for this one? I have tried various scripts with no results and you guys are my last resort
Thanks, Alex
Solved! Go to Solution.
- Labels:
-
Integrations
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-18-2016 03:01 AM
1.You can write a on start transform script to make all records active false.
2.Then map the active field of the target table like it will set true for the available records which are coming from data source.
Thanks,
Mihir
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-18-2016 02:54 AM
Hi Alex,
We are doing similar thing with the user records coming from LDAP.
var gr = new GlideRecord('sys_user');
gr.addQuery('source','!=','');
gr.addQuery('active','true');
gr.addQuery('u_last_refresh','!=','');
gr.query();
while(gr.next()){
gr.active = false;
gr.update();
}
In this code, we are checking if the LDAP import has run and then checking all the users whose record has not come and disabling them.
This can be done in POST SCRIPT of a scheduled job and you need to select enable post import script.
Basically this solution works fine if we are using a scheduled job. What are you using by the way?
Regards,
Avinash
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-18-2016 03:01 AM
1.You can write a on start transform script to make all records active false.
2.Then map the active field of the target table like it will set true for the available records which are coming from data source.
Thanks,
Mihir
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-18-2016 03:17 AM
Thanks Mihir,
Your solution was the easiest to implement. Thabks for your solution.
Thanks, Alex