Copying A Variable Value Into A Field Form
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2014 07:47 AM
We have numerous Catalog Items, where the request type is captured in the variable.
For example, "Email" is the Catalog Item, and "New Access", "Group Mailbox", "Distribution List" is captured within a variable.
With a business rule, I can copy the value of the variable onto the field on the Requested Item table.
current.u_item_type = current.variable_pool.email_access_list.getDisplayValue();
The issue I am experiencing however, is how do I expand that business rule?
If i have 50 Catalog Items, and I always want the "request type" value to populate into the Requested Item form. How should I go about doing that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2014 02:00 PM
I'm curious as to what Rachelle Sanon ended up going with?
Marcus Stewart, did you read my response (Re: Re: Copying A Variable Value Into A Field Form) in the thread?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-09-2014 03:51 AM
I haven't continue working on this, but it seems a combination of Sabrina & Oscar's suggestion would do the trick.
Thanks Guys!!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-09-2014 03:49 AM
Hi Marcus,
If the variable names are the same, it's more straight forward.
Create a field on the requested item form - "Request Type"
Then Create a before business rule that sets the value of the variable on the form.
Say for example the variable name on the catalog item is "item,
current.u_request_type = current.variable_pool.item.getDisplayValue();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2014 02:36 PM
Based on my experience, if you create fields in the RITM for all the corresponding variables from a Catalog Item you are going to kill yourself. You are going to end up with hundreds of fields in the RITM, this is going to impact performance.
Create just the minimal necessary field in the RITM to keep variable values, you most likely will do this because you want to report on these fields. Remember that ServiceNow do not provides a friendly way to report Variables from a RITM.
My recommendation for this case would be to copy all variables names and values into the Description of the RITM, put all variables concatenated, one variable/value per line. Most of the time you will need to report on such requests, hence create a custom table with all the fields based on variables and copy the variable values into the custom fields, then you will report very friendly from the custom table; down side is that you will have to create one table per type of request.
Also double check if your design make sense, sometimes you will require custom applications with Record Producers instead of the RITMs and Catalog Items.
Remember that variables shouldn't be changed once the RITM is created, it's like a receipt with all the original values when the RITM was submitted. Most of the time you may want to have variables as read only.