How to trigger if condition in the workflow based on check box value in MRVS

Balaram7
Kilo Sage

Hi all.

 

We have a requirement to trigger if condition based on the Variable values in the MRVS.

Multi Row variable set name : Configuration items

There are two check boxes in the variable set named Requirement and Replace.

I need to trigger workflow if the Requirement is marked as True it should be routed to Yes and if Replace is marked as True then it should move to No.

 

Can anyone please help me with the syntax on how to acheive this.

 

 

Thank you,

Balaram.

2 REPLIES 2

sejal1107
Tera Guru

Hi @Balaram7 

 You can try below code

I have tried it in background script its working for me you can try it in workflow

 

 

 

// Access the MRVS variable set
var mrvs = current.variables.configuration_items.toString();
gs.print("MRVS "+ mrvs);

//To fetch multirow variable set row number
var count=current.variables.configuration_items.getRowCount();
gs.print("MRVS rows "+ count);

var routeToYes = false;
var routeToNo = false;

// Loop through the MRVS rows and check checkbox values
//if in any row requirement is selected as true then routeToYes will be true and same for replace
for (var i = 0; i < count; i++) {
    var requirement =current.variables.configuration_items["requirement"][i];  // Checkbox for Requirement
    var replace =current.variables.configuration_items["replace"][i];  // Checkbox for Replace

    if (requirement == true) {
        routeToYes = true;
    }

    if (replace == true) {
        routeToNo = true;
    }
}

 

 

 

Screenshot 2025-01-22 at 9.09.27 PM.pngScreenshot 2025-01-22 at 9.09.35 PM.png

If my response really helped you then please mark it helpful.

Thanks & Regards,

Sejal

Please check and Mark Helpful and Correct if it really helped you.
Thanks & Regards
Sejal Chavan

Hi @sejal1107,

 

I tried this code unfortunately, this is not working. Could you please suggest any changes needs to be done.

Balaram7_0-1737637721511.png

 

Thank you,

Balaram.