Hi Everyone,
if(
rimod1 = 2,
{cons!member1,cons!member2),{}
)
In the above code I try to get the value from 2 constant which contain group member, but I am getting value from member1 not from member2.
can anyone help me on this.
Discussion posts and replies are publicly visible
Can you describe which outputs you get for your inputs?
I would expect that for ri!mod1 = 2 you get a list of groups. And empty list for any other value.
yes right empty list for other value, but I am able to get the value from cons!member1 .
Here I try to get get value from both cons!member1 & cons!member2 if ri!mod=2.
OK, can you post a screenshot?
I assume that your constants are both of type Group. Now what do you expect as the output? The users being member of these groups? If this is the case, use the following function get them.
docs.appian.com/.../fnc_people_getdistinctusers.html
a!pickerFieldGroups( label: "TEST", groupFilter: if( ri!mod1 = 2, {cons!member1, cons!member2},{} ))
this is the code, where I am getting only member1 value.
You saw that this field only accepts a single group as filter?
Here I want to display member from both the group, as of now it is showing only member belongs to member 1 only.
Do you want to display the members of both groups, or do you want to select users from both groups?
As I already wrote, this field only accepts a SINGLE group.
I want to display the members of both groups. How to do it ?
I already mentioned the getdistinctusers() function above. Try something like this:
a!forEach( items: getdistinctusers({cons!EOM_GROUP_ADMINS, cons!EOM_GROUP_GLOBAL_RISK}), expression: concat( user(fv!item, "firstName"), " ", user(fv!item, "lastName") ) )
The above code is working and able to get the all the value from both the constant, but it is throwing Cast Invalid error "Could not cast user to group".
Does that code snippet work or not. It cannot work and also throw an error. More details please.
I have tried the above code in expression rule and I am able to get all the value. When I am using the above code in Interface that time it is throwing error i.e "Could not cast user to group"
More details please! What do you try to do?
[assuming they're still trying to use a!pickerFieldGroups(), though i'm unclear on how or why.]
I am using a!pickerFieldUsers() in interface, where I am trying to get values from two constant which contains groups. I want to display all the value present in two groups and from that only user can select only one user.
a!pickerFieldUsers( maxSelections: 1, groupFilter: if( ri!pnrNo =2, {cons!member1,cons!member2},{} ))
as Stefan pointed out, the groupFilter parameter only accepts a single group input. If you want to allow your User Picker to access users from both groups, then you'll need to create a parent group with both of those groups as members, and point the picker field at that parent group instead. (You can wrap it in the same if() logic to check for the value of ri!pnrNo if you like).