Is there any way for a Record Producer item to not create a record?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
We currently have a Record Producer that creates a process entry in a customized table. This table was created with the intention that the process entry can be updated at any time. Our service catalog currently sets this up via a record producer which is fine initially, but if the process entry needs to be modified, we want the ability to update it if needed. While we can do the scriptwork to bring up the already created entry using Catalog Client scripts, we are wondering how do we not create a new record but to update one instead. In other words, we want to make sure that the Producer part does not create an entry in this specific scenario.
Any ideas?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
@tahnalos As per servicenow documentation Record Producers are used to create record in a table.
Preventing an insert from record producer will not align with the theme of record producer.
Here is the suggestion:
For create let the record producer be there.
For update scenario, create a catalog item whit reference field to your table so that user can select the record to be updated and then other variables/fields to be updated. The flow on this catalog item can update the selected record.
Please mark the answer correct/helpful accordingly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
I agree with the approach shared by @RaghavSh
Discuss this with your customer and let us know
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
A separate item to update the record is not what the business wants. They want the ability to bring up the record should it already be there and update it from the record producer.
The reason why they want this is that in this particular scenario, there are 3 separate unique fields that will determine if a new record is needed or not. If the 3 fields match up with what is already in the database, it is an update scenario. If it does not, it is an insert scenario. The business does not want a separate item.
Originally we had a catalog item and had the variables copied into the table in question from variables in the sc_req_item table (along with a whole bunch of customized fields, there are 15 variables and 20 customized fields in the sc_req_item table all pushing to this customized table). But we got yelled at by a ServiceNow tech saying that we shouldn't do that and we should be relying on record producers. Which is what we did but now we have the scenario that we want to update. The business wants the original Catalog item back and one selection only in their catalog, ServiceNow says they will pull support for the sc_req_item table if we do not roll back the modifications to the sc_req_item table. So we are in a tough spot.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
then in same record producer do this
1) drop down variable Add/Update
2) when Add is selected show the variables and allow record insertion
3) when Update is selected show other reference variable where user can select record
4) show the other variables and auto populate with field values
5) let user change the variables
6) in record producer script check if the value is Update then use GlideRecord and update the record and stop the record producer submission using current.setAbortAction(true)
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
