Application User Interface · Topic 4 of 4
Record Producers
CAD record producers: a catalog front end that creates records in an app table, variables mapped to fields, the producer script and catalog client scripts.
- 5 min
- A record producer is a catalog item that creates a record in a chosen table, not a requested item.
- Variables are the questions; Map to field or the script copies answers into fields.
- In the script, current is the new record and producer holds the answers.
What it is
A record producer is a Service Catalog item that creates a record in a table, instead of a requested item. Users fill in a simple catalog form with questions written for them, and the platform creates a record in your application's table from their answers.
It is the usual way to give requesters, often users with no application role, a friendly entry point to an application. They never see the full table form with its fulfiller fields.
How it works
Where record producers live
You create record producers in Service Catalog > Catalog Definitions > Record Producers, or as an application file in Studio with your application selected. The main fields are:
| Field | Purpose |
|---|---|
| Name and Short description | What the requester sees in the catalog |
| Table name | The table the new record is created in |
| Catalogs and Category | Where the producer appears in the Service Catalog |
| Variables | The questions shown to the requester |
| Script | Server side code that sets values on the new record |
| Available for, Not available for | User criteria that decide who can see and order it |
Requesters reach it through the Service Catalog or Service Portal. Because it is a catalog item, its appearance is controlled by catalog placement and user criteria, not by the table form layout.
Variables and field mapping
Each question is a variable, such as single line text, multiple choice, select box, reference or checkbox. Reusable groups of questions can be shared as variable sets.
There are two ways to get an answer into a field of the new record:
| Method | How | Use when |
|---|---|---|
| Map to field | Select Map to field on the variable and pick the target field | One answer goes straight into one field |
| Producer script | Set fields on current from producer.<variable name> | Values are combined, calculated or depend on conditions |
The producer script
In the script, current is the record about to be created and producer holds the requester's answers.
current.short_description = 'Loan request: ' + producer.item_name;
current.requested_for = gs.getUserID();
if (producer.urgent == 'true') {
current.priority = 2;
}
The platform inserts the record after the script runs, so the script must not call current.insert(), which would create a duplicate record. Other server logic, such as before business rules on the table, still runs on that insert.
Client side behavior on the producer
The catalog form is not the table form, so table client scripts and UI policies do not run on it. Use catalog client scripts and catalog UI policies, which work on variables. They use the same g_form methods, for example g_form.setMandatory('justification', true) on a variable.
Record producer or table form?
| Requirement | Better choice |
|---|---|
| Requesters with no application role submit requests in plain language | Record producer |
| Fulfillers work and update the record through its states | Table form and modules |
| Requesters should find it next to other company requests | Record producer in the Service Catalog |
| The record must be created from an email, import or API | Not a record producer; use inbound email actions, import sets or REST |
How the exam asks about this
- "Employees with no roles must submit loan requests from the Service Portal." A record producer on the loan request table.
- "The answer to one question must become the Short description of the new record." Select Map to field on that variable, or set current.short_description in the producer script.
- "A question must become mandatory when another answer is Yes." A catalog UI policy or catalog client script on the variables.
What to remember for the exam
- A record producer is a catalog item that creates a record in a chosen table, not a requested item.
- Variables are the questions; Map to field or the script copies answers into fields.
- In the script, current is the new record and producer holds the answers.
- Do not call current.insert() in the producer script; the platform inserts the record.
- Catalog client scripts and catalog UI policies work on producer variables; table client scripts do not.
- User criteria (Available for, Not available for) control who can see the producer.
Hiding a producer from users through user criteria does not secure the table. Access controls still decide who can read and change the records it creates.
Common mistakes
Calling current.insert() in the producer script. The platform already inserts the record after the script. An extra insert creates a second record.
Expecting table client scripts to run on the catalog form. The requester sees variables, not table fields. Write catalog client scripts or catalog UI policies against the variables.
Giving requesters the full table form. Requesters then see fulfiller fields and need roles. A record producer gives them only the questions that matter to them.
Check yourself
What does a record producer create when a requester submits it?
A record in the table named on the record producer, not a requested item.
Why should a record producer script not call current.insert()?
The platform inserts the record after the script runs, so an extra insert creates a duplicate record.
How do you make a producer question mandatory based on another answer?
Use a catalog UI policy or a catalog client script on the variables, because table client scripts do not run on the catalog form.
Topic 4 of 4 in Application User Interface
Test yourself on Application User Interface
The full ServiceNow CAD question bank has 600 questions, with timed practice exams and an explanation for every answer.
This study guide is independent and is not affiliated with, endorsed by, or sponsored by ServiceNow. Vendor names, certification names and exam codes are trademarks of their respective owners and are used for identification only.