Not getting sys id of the attachment when using g_form.getValue
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2022 08:11 PM
Hi. I need to grab the sys id of the submitted Attachment variable so that I can push the same image ( submitted by the user) to sc_cat item table.
I am not getting the sys_id of the attachment variable. It is coming blank when I am using getValue method. pls suggest.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2022 10:58 PM
When user is submitting the request, a RITM _Task is getting generated and I do see attachments in activity Stream of both RITM as well as TASK.
I am also able to get the attachment in sys_attachment Table using sys_id of the Catalog Task.
All I now need to do is to push the same picture and icon to sc_cat_Item table picture and icon.
My requirement is to copy the picture and icon which user has submitted in via request to corresponding catalog Item
Also, I am trying to get either the name or the sys_id of the attachment variable field on Business rule ( written on sc_task) and I am not getting either. Display Value, getValue are not working so I am not able to move forward. Alll I am getting is null or undefined
var task_sysid = current.getUniqueValue();
var p1 =current.getDisplayValue("picture1");
gs.log(p1, "valu is 1");
var p3 = current.variables.getValue("picture1")
gs.log(p3, "valu is 3");
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2022 11:35 PM
Hi,
then use after insert BR on sc_task and logic I already shared in the link
you will have to tweak it a little bit
How to copy attachment from one File attachment field to another table
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2022 05:56 AM
I tried it Ankur. It doesnt work. Image type field ( Icon field of the catalog Item) doesnt take sys_id . So pushig sys_id of the attachment didnt work