
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2021 11:37 AM
I'll start this by saying that I think that this is a coding noob question, but I'll post it anyway. I've set up a custom table, u_supported_applications, for a series of applications that our group supports. The table is pretty simple right now, just a list of 30 or so entries, with two fields, a name string and "hosted by," also a string. A table was created because, for the most part, these are applications that we don't "own" (i.e. hosted by outside agencies and other governments with no CIs in our instance) and there's a lot of variations to how they're used and deployed. The table has been used as part of a record producer, for typical incidents, such as account unlocks and support follow-up, which is where the problem is.
In the scripting, I'm trying to simply get the name string from the referenced table so that I can include it in the work notes or short description when the ticket is generated. However, nothing I've tried so far in the scripting returns the name string, just the sys_id. I'd include a code snippet but I've probably been through 20 or so variations without any success, So, Within the context of a record producer, what's the right method to call?
Again, sorry for the basic question and thanks for any advice,
Derek
Solved! Go to Solution.
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2021 12:06 PM
In the Script field on the Record Producer definition, you can use a line like this to copy the Display value of a reference variable to a field on the record that is produced.
current.fieldname = producer.variablename.getDisplayValue();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2021 11:49 AM
Don't be sorry about asking any question. Without knowing much about what you are really trying to do, you should be able to get the display name with something like:
producer.variable_name.field_name.toString()
I'm assuming this is in the "Script" field of the Record Producer itself? Can you include what you currently have?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-22-2021 12:41 PM
I actually hadn't tried that but it didn't work. I didn't provide much to go on but this is the (simplified) snippet:
var reportedApplication = producer.swf_common_applications.getDisplayValue();
var reportedApplicationIntro = 'Faulty Software Reported: ';
var reportedApplicationEntry = reportedApplicationIntro + reportedApplication;
current.short_description = reportedApplicationEntry;
I've been beating on this, off and on, for a day so pardon the long identifiers and the verbose syntax.
This good news that another post did work but thanks all the same!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2021 12:06 PM
In the Script field on the Record Producer definition, you can use a line like this to copy the Display value of a reference variable to a field on the record that is produced.
current.fieldname = producer.variablename.getDisplayValue();

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-22-2021 12:45 PM