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.
[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).
I still do not understand why you try to use a user picker field to display users. While possible this does not make a great UI.
Have a look at the below pattern and replace the code in line 7 with the working code i posted.
docs.appian.com/.../user-list-pattern.html
Unknown said:why you try to use a user picker field to display users
Consider that he might just be trying to ["see"] a certain set of users in the picker field, in the sense of the standard use case for the user picker field. That's my reading here.
To me this sounds like a great case for a!dropdownField() populated from 2 groups, with it's built-in search capability. Assuming the use case is #1, which is not yet clear here.
1) Select a single user from a list of users who are in one of 2 groups
2) Select a group (hence the pickerFieldGroups?), but have the members on display in a component nearby?
yes you are right Mike Schmitt
But then, this is what the value parameter of the field is used for.
This thread is intriguing. My current questions are:
If you are only displaying users read-only, why do you need to do it in a picker field (vs a text field)?
Does this not work for you?
a!pickerFieldUsers( label: "Users", readOnly: true, value:getdistinctusers({ cons!member1, cons!member2 }) )
Chris said:only displaying users read-only
OP never said this (or really anything like it) beyond perhaps some incorrect assumptions in earlier replies.
Refer to this comment, where they [eventually] clarified a bit,
minhajk0001 said: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.
My personal translation of this (going for what they mean, rather than their exact wording, that is) is something like the following:"I am using a!pickerFieldUsers(), and want to allow it to select from among 2 distinct groups that I'm referencing using two constants, to allow the form user to make a single selection."
To which the answer is (as i posted before), OP needs to create a designated Parent Group to contain both target groups in question, and refer to that one in the picker field.