Flow designer - custom actions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-14-2024 11:04 PM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-15-2024 01:31 AM
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
Cheers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-15-2024 01:53 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-15-2024 01:56 AM
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)
Hope that helps, thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-15-2024 05:31 AM
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 .