True or False variable values
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2018 08:12 AM
Hi,
Anyone please help me with the requirement.
I have Checkbox variables on the form, lets as shown below. It contains Column 1 and Column 2.
If any one of the variable on Column 1 and Column 2 is selected on the workflow, then it should return as "YES".
If only Column 1 or Column 2 any of the variable is selected then it should return as "NO".
How can I achieve this type of requirement.
Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2018 09:21 AM
TRy this
// All I regions
var All_I = current.variables.All_Infiniti;
var East = current.variables.East;
var Northwest = current.variables.Northwest;
var West = current.variables.West;
var Mountain = current.variables.Mountain;
var North = current.variables.North;
// All N Regions
var All_N = current.variables.All_N;
var North_East = current.variables.North_East;
var Mid_Atlantic = current.variables.Mid_Atlantic;
var SouthEast = current.variables.SouthEast;
var Mid_West = current.variables.Mid_West;
var All_west = current.variables.All_west;
var Central = current.variables.Central;
var column1 = '';
var column2 = '';
if(East || Northwest || Mountain || West || North)
{
column1 = true;
}
if(North_East || North_East || Mid_Atlantic || SouthEast || Mid_West || All_west || Central)
{
column2 = true;
}
if(column1 && column2 )
{
return 'yes';
}
else
{
return 'no';
}
}
also use alerts to see what where all the code is going?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2018 09:40 AM
Hi Anurag,
script is not working.
Even I have selected only one checkbox variable from column1, it is still returning answer as yes.
requirement is like column1 side and column2 side checkbox variables, if atleast one variable is selected each side then it should return as "yes", if only one column variables are selected and other column variables are empty then it should return as "NO".
I am not getting what is wrong. 😞
Thank you.