Hi Team,
Wanted to know how this would be possible?
I am using a filter to route forms submitted to specific users. I have found after a lot of trials and error the following:
1. If I have the AD\Username within the filter it based on the below Method:
if(_.indexOf(['AD\Username'],$util.getValue('FIELDNAME'))>-1)
{
$result=team.findMembersByRole('ROLEASSIGNED');
}
If I have lines in this filter and remove the >-1 as per below for the top line,
if(_.indexOf(['AD\Username'],$util.getValue('FIELDNAME')))
{
$result=team.findMembersByRole('ROLEASSIGNED');
}
if(_.indexOf(['AD\Username'],$util.getValue('FIELDNAME'))>-1)
{
$result=team.findMembersByRole('ROLEASSIGNED');
}
It will give me the output for the first line, but if I test it with the 2nd AD\Username user, it results with output for the first line again?
If I then change the >-1 around and input it in the last line as per below:
if(_.indexOf(['AD\Username'],$util.getValue('FIELDNAME'))>-1)
{
$result=team.findMembersByRole('ROLEASSIGNED');
}
if(_.indexOf(['AD\Username'],$util.getValue('FIELDNAME')))
{
$result=team.findMembersByRole('ROLEASSIGNED');
}
The result of that always defaults to the last ROLEASSIGNED
2. If I change this setup / the script to the below:
if($util.getValue('FIELDNAME') == 'AD\Username)
{
$result=team.findMembersByRole('ROLEASSIGNED');
}
if($util.getValue('FIELDNAME') == 'AD\Username')
{
$result=team.findMembersByRole('ROLEASSIGNED');
}
This always errors out with the below:
but if I change it slightly and remove the AD part as per below:
if($util.getValue('FIELDNAME') == 'Username)
{
$result=team.findMembersByRole('ROLEASSIGNED');
}
if($util.getValue('FIELDNAME') == 'Username')
{
$result=team.findMembersByRole('ROLEASSIGNED');
}
That works without any issues.
As the client AD is setup with Name and Username being AD\Username how can I target this with Filters?
Many thanks in advance,
Ziad