Additional Condition on Approval User Activity

saikatmitra
Tera Contributor

Hi Team,

My requirement is to add another condition like 'Approved' and 'Rejected', called 'More Information Required' in the Approval Group Activity,

 

so I have created the condition 'More Information Required' in the workflow activity

and added the same in Choices of State field on Approval(sys_approval_approver) table.

 

And in the condition field added : activity.result =='more_info_required'

 

Now, when I select approve or reject the workflow goes to the next activity but not when I select More Information Required in the

approval table record, it gets stuck in the same activity and doesn't proceed.

 

find_real_file.png

 

I am sure I am missing something, I don't know how does the activity.result gets set to the state(like in case of approve and reject)

 

Can someone please help me on this.

 

 

Thanks in advance

 

16 REPLIES 16

Willem
Giga Sage
Giga Sage

You have to specify the conditions for approval in the 'Conditions for approval', like this:

if (approvalIDs['more_info_required'])
		answer = 'more_info_required';

 

Her is an example:

find_real_file.png

You have to set it to 'Condition based on script':

find_real_file.png

Hi Willem,

 

Thanks for your time but it is not working for the Approval Group activity. I need this for Approval Group activity. 

 

find_real_file.png

 

It is showing "Running" while iteration and answer might be coming null.

find_real_file.png

Hi, you have to do it in similar way for groups:

  • You have to add the 'more_info_required' to  the 'Group Approval'-table [sysapproval_group]
  • You can check the approval groups using: groups[group_id].approvalIDs[state]
for (var id in groups) {
    groups[id].approvalIDs[state]
}

 

You can figure out when to set the workflow to 'more_info_required' and as end result include:

answer = 'more_info_required';

 

So for example if you want to set it to more info required when one group sets it to that, you can use:

for (var id in groups) {
    if(groups[id].approvalIDs['more_info_required']){
        answer = 'more_info_required';
    }
    
}

 

Let me know if this helps.