How to retrieve record producer variable value in Business rule
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-28-2023 02:40 AM
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.
Regards,
Musab
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-28-2023 02:43 AM
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
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-28-2023 02:51 AM
Do you have sample script for that ? is there no other solution for this ?
Regards,
Musab
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-28-2023 02:56 AM
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
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-28-2023 02:51 AM
any variable value can be accessed in BR using current.variables.variableName syntax
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
