Copy field value from one field to another in same table

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2022 01:57 AM
Hi all,
I'm facing a trouble while trying to copy the field values -Basically we have a custom table with few task types and there are two fields present in the Task A ,I need to copy the fields values from Task A type to the fields under the Task B type. Can anyone help me out with this please?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2022 02:08 AM
Hi,
Something like this will work
var gr = new GlideRecord('<your table>');
gr.addQuery('add query to filter records you want to copy the fields for');
gr.query();
while(gr.next())
{
current.<target field name> = current.<source field name> ;
current.<target field name> = current.<source field name> ;
current.update();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2022 02:47 AM
Hello,
Can you paste some screenshot it would be easier to assist you.
Thanks.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2022 03:06 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2022 03:10 AM
Why are you doing this on a BR and not via fix script/backgroup script?
Is this a one time copy or something that you do as part of your process?