How to Sync sys_user image to Live_profile image
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-02-2019 04:01 AM
HI Team,
I have a requirement to sync photo from Custom User Profile table to sys_user table and live_profile table. I tried scripting it but it's not working. I am just not able to update the image in live_profile using script. It's working perfectly fine for user table but not getting inserted in live_profile table.
Here is the before business rule script I have added.
var image_sysid = current.u_photo;
var user_sysid = current.u_parent.u_user;
//update user table image
var usr = new GlideRecord('sys_user');
usr.addQuery('sys_id',user_sysid);
usr.query();
while(usr.next()){
usr.photo = image_sysid;
usr.update();
}
// update live profile pic
var liveprofile = new GlideRecord('live_profile');
liveprofile.addQuery('document',user_sysid);
liveprofile.query();
while(usr.next()){
liveprofile.photo = image_sysid;
liveprofile.update();
}
I am going clueless about how to fix this. Any inputs/guidance you give will be of great help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-19-2020 02:51 AM
hi Krishna,
I too have the same requirement, did you get any solution for this?if so please can you share the code.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-24-2020 12:48 AM
no luck yet 😞
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-21-2021 01:59 PM
Has there been any advances on this? I've just posted a very similar question and I've managed to update other fields from live_profile like the short_description, but not the photo.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-21-2021 10:42 PM
No luck. I have stopped looking for the solution 😞
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-04-2022 06:23 AM
This URL has the correct script.
https://community.servicenow.com/community?id=community_question&sys_id=3df01381db4e7bc0d58ea345ca961918