How to retrieve record producer variable value in Business rule

Musab Rasheed
Tera Sage

Hello,

 

We had a requirement to Populate 'Source' field on HR case table with Now mobile/Service portal depends on where it was created, We have achieved this by created variable and setting it through client script. Issue here is variable which we are hiding on Record producers is getting copied to HR case description field so to avoid that I want to make my Variable blank once record is submitted, I have gone through so many threads but In BR on HR case table I'm not able to fetch variable value. Please help.

 

Things I tried.

 

gs.info("Current cat value is1"+ current.variables.link);
And
gs.info("Current cat value is1"+ current.variable_pool.link);
 
Please help to understand how I can fetch record producer variable in Business rule to make it blank before insert so that it should not get captured in 'Description field'.
 
MusabRasheed_0-1687945201414.png

 

Please hit like and mark my response as correct if that helps
Regards,
Musab
5 REPLIES 5

Ankur Bawiskar
Tera Patron
Tera Patron

@Musab Rasheed 

the issue is the description field gets populated once you submit the record producer.

So 1 thing you can do is before insert check if the description contains that label.

If yes then ensure you remove that label and value and keep the other string intact and then set the value

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

Do you have sample script for that ? is there no other solution for this ?

Please hit like and mark my response as correct if that helps
Regards,
Musab

@Musab Rasheed 

I don't think any other way.

you can clear the variable value after the record is inserted but it makes no sense since the description already captured that variable

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

Ankur Bawiskar
Tera Patron
Tera Patron

@Musab Rasheed 

any variable value can be accessed in BR using current.variables.variableName syntax

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