Record producer is creating new user in user table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-24-2024 11:42 PM - edited 06-25-2024 04:48 AM
I am trying to send data from record producer to employee table and it is creating new user although i select the existing user from sys_user table - it is giving " primary email device created" message . Below are the screenshots of configurations
Record Producer
Requested For variable
Employee form to which we need to send data
#record producer # Service catalog @SNlearner @Ankur Bawiskar @SN_Learn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-24-2024 11:46 PM
Hi @Vijay Kummamuru,
please check below link:
Thank you, please make helpful if you accept the solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2024 08:01 PM
record producers are meant for record creation on target table.
please share complete business requirement here
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2024 09:11 PM
Hi @Vijay Kummamuru ,
When you submit the record producer it is expected behavior to create/insert record on the table selected in the record producer.
If you want to update the record rather than insert/create. You can try the below script in the script part of Record producer:
var getReqID = producer.u_requested_by; //Replace the field name
var updateEmpDetails = new GlideRecord('sys_user');
updateEmpDetails.addQuery('sys_id', getReqID);
updateEmpDetails.query();
if (updateEmpDetails.next()) {
updateEmpDetails.first_name = producer.firstName; //replace with correct name
updateEmpDetails.last_name = producer.lastName; //replace with correct name
updateEmpDetails.manager = producer.manager; //replace with correct name
updateEmpDetails.update();
current.setAbortAction(true); //This will prevent the insert/creation of new record
}
Mark this as Helpful / Accept the Solution if this helps
Mark this as Helpful / Accept the Solution if this helps.