- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-27-2022 07:46 PM - edited 12-27-2022 07:55 PM
Hi All,
We are trying to import new project records into pm_project table. We have created project template excel with required fields and added project records.
This is insert scenario, not update. So Number field is empty and there is no coalesce field in our scenario.
Our source table is u_latest_project_import and target table is pm_project.
I have not written any script for import and I have done direct field mapping only.
All the fields are imported successfully, except the work notes field.
I see the data related to my records in sys_journal_field table.
I am new to ServiceNow , please help me with script, how to populate the data from sys_journal_field to respective record in pm_project table .
Thanks,
Talya
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-27-2022 08:11 PM
Hi,
You have mapped it to "comments_and_work_notes", which is a Journal List field.
Please map it to "work_notes" field and try.
Thanks,
Arav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-27-2022 08:11 PM
Hi @Talya ,
Field map script may not work. You need to have an onBefore() script in place to make this work. Remove the field mapping & try below onBefore() script. This is the sample Script :
(function runTransformScript(source, map, log, target /*undefined onStart*/ ) {
var inciworknotes;
var inci = new GlideRecord('incident');
inci.addQuery('number', source.number);
inci.query();
if (inci.next) {
inciworknotes = source.u_worknotes;
target.work_notes = inciworknotes.toString();
}
})(source, map, log, target);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-27-2022 08:11 PM
Hi,
You have mapped it to "comments_and_work_notes", which is a Journal List field.
Please map it to "work_notes" field and try.
Thanks,
Arav

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-28-2022 03:16 PM
@Talya Checking back to see if the approach suggested worked ? If yes, please mark the response as correct.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-29-2022 02:48 PM
@Arav Thank you, I just accepted as solution.