Get Lookup Select Box value in Flow Designer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2023 12:55 PM - edited 04-23-2023 01:48 PM
Hi
UPDATE - I have retrieved the value using
Asset select box:
Model Category
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2023 08:05 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2023 09:18 AM
Use this script, as you are using it directly to update the record we should pass the GlideRecord instead of asset tag only.
var lab = fd_data.trigger.request_item.variables.allocate_asset_tag_serial_number;
var gr = new GlideRecord('alm_asset');
gr.addQuery('sys_id', lab);
gr.query();
var asset_tag;
if(gr.next()){
return gr;
}
return ;
Anvesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2023 09:28 AM
Should the last return be asset_tag? of gr? I ask because it doesn't have a value and asset_tag is defined and not used
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2023 10:38 AM
The last is to return the GR, as the update record expects GlideRecord object as it's input parameter.
Anvesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2023 08:15 AM
get the variable value i.e. sysId
Query the table and get the asset tag
something like this
var lab = fd_data.trigger.request_item.variables.allocate_asset_tag_serial_number;
var gr = new GlideRecord('alm_asset');
if(gr.get(lab)){
return gr.getValue('asset_tag');
}
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader