ifScript - Count Checkbox to answer True of False
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2024 06:52 AM
Mark Lanning
Mega Guru
02-07-2024 08:15 PM
Currently working on a Requirement - Where I have 8 Checkboxes, depending on the number of Checkboxes that get selected, I need the Workflow to take two different paths.
If 1 Checkbox is selected, path A
If 2 or more are selected, path B
Everything I am finding is OnSubmit, or OnChange Script, nothing with IfScripts and I am wondering if its possible.
answer = ifScript();
var ch1 = g_form.getValue('variable name ');
var ch2 = g_form.getValue('variable name ');
var ch3 = g_form.getValue('variable name ');
var ch4 = g_form.getValue('variable name ');
var ch5 = g_form.getValue('variable name ');
var ch6 = g_form.getValue('variable name ');
var ch7 = g_form.getValue('variable name ');
var ch8 = g_form.getValue('variable name ');
var cnt = 1;
function ifScript() {
if (ch1 == 'true') {
cnt++;
}
if (ch2 == 'true') {
cnt++;
}
if (ch3 == 'true') {
cnt++;
}
if (ch4 == 'true') {
cnt++;
}
if (ch5 == 'true') {
cnt++;
}
if (ch6 == 'true') {
cnt++;
}
if (ch7 == 'true') {
cnt++;
}
if (ch8 == 'true') {
cnt++;
}
if (cnt >= count) {
answer = true; {
return 'false';
}
}
}