- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-11-2022 08:59 AM
In a business rule how can I test for the presence of a mrvs in a record created from a record producer. I can check if there are variables using if (current.u_variables_present == true) but it's not including the mrvs. Is there an equivalent statement for mrvs?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-11-2022 09:37 AM
Is there any field which you are populating in the target table to identify record created from which record producer?
If yes then you can get that record producer sysId and query "io_set_item" with that record producer with type as this
var recordProducerSysId = current.u_record_producer;
var query = 'variable_set.type=one_to_many^sc_cat_item=' + recordProducerSysId;
var gr = new GlideRecord("io_set_item");
gr.addEncodedQuery(query);
gr.query();
if (gr.next()) {
// this record producer has MRVS in it
}
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-11-2022 09:01 AM
Hello
you need to check like this
current.variables.your_mvrs_backend_name;
PLEASE MARK MY ANSWER CORRECT IF IT HELPS YOU

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-11-2022 09:03 AM
Hi,
Please refer to this link
Getting Values from Multi Row Variable Set Record Producer
Mark Correct or Helpful if it helps.
***Mark Correct or Helpful if it helps.***
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-11-2022 09:21 AM
Thanks for your suggestions, but this is a business rule that handles records from multiple record producers. There is no set name of the mrvs. I'm trying to see if an mrvs is present at all and to copy its values to a text field in another record.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-11-2022 09:37 AM
Is there any field which you are populating in the target table to identify record created from which record producer?
If yes then you can get that record producer sysId and query "io_set_item" with that record producer with type as this
var recordProducerSysId = current.u_record_producer;
var query = 'variable_set.type=one_to_many^sc_cat_item=' + recordProducerSysId;
var gr = new GlideRecord("io_set_item");
gr.addEncodedQuery(query);
gr.query();
if (gr.next()) {
// this record producer has MRVS in it
}
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader