Live Profile
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-29-2023 08:05 AM
Create a fix script that from the live_profile table goes into the sys_user table and finds a match on name (name on user record = name on live profile record) and sets the Field to that record's sys_id.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-29-2023 09:23 AM
I am assuming that you want to set the 'name' field on live_profile records to be the sys id of the User record it is referencing.
You already have the sys id of the user in the 'document' field. It is a reference to the user record. However you could make a fix script to do this. You do not even need to query the sys_user table.
Just take the values in the 'document' field in the live_profile records and put it in the 'name' field.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-29-2023 09:37 AM
What is the fix script for fetching the data

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-29-2023 09:45 AM
You would want to get all of the live profile records to be updated, loop through them, and set the field to what you want & update().
You could do something like this:
var liveProfiles = new GlideRecord("live_profile");
liveProfiles.addQuery('active', true);
while(liveProfiles.next()) {
//set the name to equal the value of 'document' field
liveProfiles.name = liveProfiles.document;
liveProfiles.update();
}
I didn't actually try this, but you would do something very similar. I am just querying for all the live_profile records that are active, looping through them, and setting the 'name' to be the value of the 'document' field.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-25-2023 09:22 AM
we have fetching the data from user table not from 'document' field for that we have to write fix script