The Zurich release has arrived! Interested in new features and functionalities? Click here for more

Why the request for field is populated with the current login user

Alon Grod
Tera Expert

When I created a new catalog item request, the request for field of the sc_request table is populated automatically with the current login user instead of the taking the value from the request for variable. How can I make sure that this field will populate automatically with the request for variable from the catalog item. Again, Im talking about sc_request table.

20 REPLIES 20

Prince Arora
Tera Sage
Tera Sage

@Alon Grod ,

 

I have noticed in my PDI, default value for "requested_for" variable has set to loggedIn user, so it has came from there

PrinceArora_0-1681648015328.png

 

 

If my answer solved your issue, please mark my answer as Correct & 👍Helpful based on the Impact.

 

Rahul RJ
Giga Sage
Giga Sage

@Alon Grod This is happing due to the default value on requested for field you can check this reference 

RahulRJ_0-1681647801799.png

 

To set the requested for field from the catalog variable you can onbefore business rule hope this link can help you 

Please mark the answer correct/helpful based on Impact.

Regards,

RJ

@Rahul RJ hi, i double checked and there is no default value on this field. I tried to create on before insert BR on the sc_request table and now when submitting a request using catalog item the requested for field is not populated at all (empty). Before the BR it was populated with current login user. 
what am I doing wrong?

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

  // Get the requested for variable value from the catalog item request
  var requestedFor = current.variables.requested_for;
  
  // Populate the requested for field on the sc_request table with the requested for variable value
  current.requested_for = requestedFor;

})(current, previous);