Querying sys_journal_field from workflow
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-08-2023 11:55 AM
Hi,
I am trying to figure out why my script is returning null from my query. Basically I know the element_id is in the table and the query does run but once it its the gs.log portion it prints out "IS THIS CORRECT" but the value it returns for the column is null or undefined.
This is just a snippet of the full script but this part is where I am running into issues.
var gr = new GlideRecord('sys_journal_field');
gr.addQuery('element_id', '=' ,'elementID');
gr.query();
gs.log('IS THIS CORRECT ' + gr.getValue('value'));
1 REPLY 1

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-08-2023 12:43 PM
Try below
var gr = new GlideRecord('sys_journal_field');
gr.addQuery('element_id', '=' ,'elementID');
gr.query();
if(gr.next()){
gs.log('IS THIS CORRECT ' + gr.getValue('value'));
}