Send a Record Producer to user from a ticket and then update the ticket with completed form

Dan Brown2
Kilo Sage

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

4 REPLIES 4

Sohithanjan G
Kilo Sage
Kilo Sage

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);

}

 

Please mark as Accepted Solution if this solves your query and HIT Helpful if you find my answer helped you. This will help other community mates too..:)

Sumanth16
Kilo Patron

Hi @Dan Brown2 ,

 

Please refer to below thread:

 

https://www.servicenow.com/community/itsm-forum/need-to-update-records-with-record-producer/td-p/489...

https://www.servicenow.com/community/developer-forum/record-producer-how-do-we-update-the-same-case-...

 

If I could help you with your Query then, please hit the Thumb Icon and mark it as Correct !!

 

Thanks & Regards,

Sumanth Meda

 

 

Dan Brown2
Kilo Sage

@Sohithanjan G @Sumanth16 

 

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

Hi @Dan Brown2 , 

 

Thats still possible by using form widget. 

SohithanjanG_0-1710188210862.png

URL Parameters

The form widget accepts the following parameters within the URL. Add these parameters to the page URL to display a specified record with the form widget.
Form widget URL parametersParameter Description
sys_id or sl_sys_idSys_id for the record to be displayed
table, sl_table, or tTable for the record to be displayed
view or vView used to display the record
In the following example, the URL would display an incident with a sys_id of 1c741bd70b2322007518478d83673af3 in the portal view.
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/...

 

🙂

Please mark as Accepted Solution if this solves your query and HIT Helpful if you find my answer helped you. This will help other community mates too..:)