- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2025 07:32 AM
Hi,
We have a requirement to populate a variable on a Requested Item with the user in the 'requested_for' field on the Requested Item record.
The problem is, we cannot access the 'requested_for' value using a client script. We have tried a variety of commands: g_form.getValue('requested_for'), g_form.getUniqueValue('requested_for'),
g_form.getReference('request_item.requested_for').
getUniqueValue is the only command that returns anything but it is just the sysID of the RITM.
The client script is onLoad and the checkbox 'Applies on Requested Item' is ticked.
Any help is much appreciated!
/Kim
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2025 01:25 PM
I think the main problem here is that catalog client script do not have access fields on the request item table. I'm also positive that client scripts on the request item table do not have access to variables. So I would use a before insert business rule. The conditions could be just a list of Catalog Items it need to run agents and then the code would be as simple as something like below.
current.variables.location = current.requested_for.location; (depending on how you are setup this part may need to be current.request.requested_for.location)
You will need to put your own variable name in there and associated it to the correct field you want from the user table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2025 07:42 AM
Hello @kim-lindgren
Can you please tell us this population of field is happening from where? What is your use case? As usually this field is auto populated over RITM when a request is placed from portal for any Service Catalog Item.
Thanks & Regards
Viraj Hudlikar.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2025 07:44 AM
So is the requested for a variable on the catalog item?
or
Do you have 2 step checkout turned on?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2025 12:28 AM
@Viraj Hudlikar The population is happening from the submitted Requested Item record. There is a field on the record called 'requested_for'. The use case is adding user-related information to the outgoing approval email.
@Brian Lancaster No, Requested for is not a variable in the catalog item, we want to avoid that if possible. We do have 2 step checkout and Requested for is filled out in the second step. But after submission, we need to populate hidden variables related to the 'Requested for' user data.
Thanks,
Kim

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2025 01:25 PM
I think the main problem here is that catalog client script do not have access fields on the request item table. I'm also positive that client scripts on the request item table do not have access to variables. So I would use a before insert business rule. The conditions could be just a list of Catalog Items it need to run agents and then the code would be as simple as something like below.
current.variables.location = current.requested_for.location; (depending on how you are setup this part may need to be current.request.requested_for.location)
You will need to put your own variable name in there and associated it to the correct field you want from the user table.