Flow designer - custom actions

Nadeem Basha
Tera Contributor

Hi Team ,

I would like to know how what script can be written in flow designer custom action to check if more than 2 check boxes variables are selected in the RITM .

I have got a sample code below that runs on client script but i need some adjustment in the code that i can use in custom action of flow designer so that depending upon the output i can continue the flow .
For example if two check boxes are selected i can assign a user to ABC team and if not i can assign user to XYZ team in the flow.


Sample code which requires adjustment :

 

 

function onChange(control, oldValue, newValue, isLoading) {


      var mandatoryVars = ['option1', 'option2', 'option3', 'option4', 'option5'];
      var requiredCount = 2;
      var actualCount = 0;
        for (var x = 0; x < mandatoryVars.length; x++) {
         if (g_form.getValue(mandatoryVars[x]) == 'true') {

                       actualCount++;


               }


       }


       if (actualCount>=requiredCount) {


               return true;
} 

}

 

 

 

Thanks

8 REPLIES 8

James Chun
Kilo Patron

Hi @Nadeem Basha,

 

With the Flow Designer, you don't have to write so much code.

First, use the 'Get Catalog Variables' Action to retrieve all the variables from the RITM.

Then use an If/If else Flow logic, something like

JamesChun_0-1710491471106.png

 

Cheers

 

Hi James,

 

With "Get Catalog Variables" action how can we check if 2 or more check boxes are selected in the RITM ?

We have to write a script in custom action to check in an RITM if 2 or more check boxes are selected or not ?

Is it not correct?

Awaiting your response

 

Thanks

 

Ah, so you are trying to check the total number of selected checkboxes. If so, you can create a Flow variable and use a script like below (haven't tested it)

JamesChun_0-1710493003841.png

Hope that helps, thanks

Hi James,

 

i am trying to check if 2 or more check boxes are selected so that i can return true and if not false.

Also i dont see any flow variable to assign it to data pill ,it is empty .

 

NadeemBasha_0-1710505885284.png