- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2023 02:31 PM
Hi,
I have multiple check box type variable. Based on there selection, the approval should gone to particular user.
For ex: I have 3 check box variables viz. a, b, c.
- If a user selects a, then approval should be gone to 1 user
- If a user selects b, then approval should be gone to 2 user
- If a user selects c, then approval should be gone to 3 user
- If a user selects all three of them i.e. a, b, c, then approval should be gone to 1, 2, 3 respective users.
I have used below script in "Approval user" activity in workflow
var answer = [];
if (current.variables.a = true) {
answer.push("4e6f97291b3ce01019c25fc4464bcbd7"); //(1 user sys id)
}
if (current.variables.b = true) {
answer.push("5100a7291b7860107e64a86fe54bcbfc"); //(2 user sys id)
}
if (current.variables.c = true) {
answer.push("bbaf53a91b3ce01019c25fc4464bcb07"); //(3 user sys id)
}
Now problem is, every time am selecting any 1 or 2 checkbox out of 3. It is sending approval to all 3 users.
Please Help!!!
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2023 03:28 AM
Hi @Aavi ,
Just use this, it will work
current.variables.a == 'true'
if this solves your problem mark this as correct and helpful.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2023 09:34 AM
Hi @Community Alums ,
Now if am selecting more than one check box, approval is going to the persons as requested. But once any user approved the request, it is showing "No approval required" for other users.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-13-2023 09:48 PM
Hi @Aavi,
In the approval activity, Condition for approval section we have wait for field select Everyone to approve.
Regards
Anand
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2023 03:32 AM
Hi @Aavi ,
There is a mistake in your code, you should use == or === for comparison, but your are using = (assignment) operator which evaluates to true and sending approvals to all 3 approvers.
And, the CheckBox variable is of type object and you are comparing it to boolean (true/false) type, Modify the code like the one below.
var answer = [];
if (current.variables.a.toString() === 'true') {
answer.push("4e6f97291b3ce01019c25fc4464bcbd7"); //(1 user sys id)
}
if (current.variables.b.toString() === 'true') {
answer.push("5100a7291b7860107e64a86fe54bcbfc"); //(2 user sys id)
}
if (current.variables.c.toString() === 'true') {
answer.push("bbaf53a91b3ce01019c25fc4464bcb07"); //(3 user sys id)
}
Thanks,
Anvesh
Anvesh