Why Requested For is auto populating incorrectly in Request summary and RITM record?

Ankita28
Giga Contributor

Hi Community,

I created a request for Aaron Shelly from portal and submitted the form.

After Submitting the form,in Request Summary showing Requested For as incorrect user name.

In platform,for REQ Requested For is showing correct.

 

but for RITM,its showing incorrect user name.

 

Could anybody please help with this issue?

Thanks,

Ankita

 

19 REPLIES 19

Hi,

I think requested for is a custom field on RITM.

Because as per the screenshot both are having different values and if it is coming from the request form then both should have the same values.

Hi,

that might be the case.

@Ankita - check if the field on RITM form is dot walked from request field or custom field?

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi Ankur,

In REQ,requested for is populating correctly.But in RITM,its populating as requestors name.

So for this I created a before business rule for RITM but still it's not working.

(function executeRule(current, previous /*null when async*/) {

// Add your code here
var grRITM = new GlideRecord('sc_req_item');

grRITM.addQuery('request', current.sys_id);

grRITM.query();

while (grRITM.next()) {

if (!JSUtil.nil(grRITM.variables.requested_for)) {

current.requested_for = grRITM.variables.requested_for; //I am assuming requested_for variable here from form.

}
}

})(current, previous);

 

Hi Ankita,

Did you check requested for is a custom field or rendering from Request table?

Instead of writing a business rule, place this script in the catalog item workflow.

Try this script,

if (current.variables.requested_for) {

current.requested_for = current.variables.requested_for.toString(); //I am assuming requested_for variable here from form.

}

 

Note: The same script works in the business rule also.

Hi  Balaji,

Requested For is OOB field.In the workflow,run script is setting the requested for value.