Send a Record Producer to user from a ticket and then update the ticket with completed form
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2024 08:38 AM
Hi, has anyone come up with a method to send a record producer link to a user from a record and then when it is complete it updates the same record with the variables?
For example an incident comes in by email - but there is a record producer that could be used, and contains many questions to cover this request. Rather than sending the link and closing the incident - then having a new one opened, use this completed form to update the current incident.
Many thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2024 08:45 AM
Hi @Dan Brown2
Are you looking update existing record with RP ? You can use gr.update() for the specific queried record & followed by current.setAbortAction()
Sample Script:
var num= producer.inc_number;
var review = new GlideRecord('incident');
review.addQuery('number', num);
review.query();
//if we find a record update it
if (review.next()) {
review.field_name = producer.variable_name;
review.update();
gs.addInfoMessage("The record has now been updated");
current.setAbortAction(true);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2024 09:03 AM
Hi @Dan Brown2 ,
Please refer to below thread:
If I could help you with your Query then, please hit the Thumb Icon and mark it as Correct !!
Thanks & Regards,
Sumanth Meda
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2024 05:06 AM
Thanks for the replies - they are really helpful.
I was wondering, would it make sense to actually update/add the variables relating to the original record, rather than update fields on the form?
Is there a way this is possible?
Thanks again,
Dan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2024 01:18 PM
Hi @Dan Brown2 ,
Thats still possible by using form widget.
URL Parameters
sys_id or sl_sys_id | Sys_id for the record to be displayed |
table, sl_table, or t | Table for the record to be displayed |
view or v | View used to display the record |
https://example.service-now.com/sp?id=form&table=incident&sys_id=1c741bd70b2322007518478d83673af3&view=portal
Further to this you can refer here
https://www.servicenow.com/community/developer-blog/adventures-in-service-portaling-the-form-widget/...
🙂