best way to find members of a group

Hi,

I have a process where I know the name of the group that I want to assign the task to.  I need to get the members of the group and store it in a pv of type user (multiple).

Can anyone recommend a good way to do that?

 

Thanks.

  Discussion posts and replies are publicly visible

Parents
  • Hi gary, We have a shared component that comes with the functions - getgroupbyname() & getgroupmemberuserspaging() - which will serve your purpose. Please find the URL below:
    forum.appian.com/.../summary
  • @poorna - thanks. What's the best way to get the group Id of a group if I know the name?
  • @poorna - I am justing out this getdirectgroupmemberuserspaging in a script task. I am getting the group Id for a group using tointeger(<group name>) and I am getting the error below. Any ideas why?

    There is a problem with task “Script Task” in the process “Test_getGrpupMembers”. ERROR:An error occurred while evaluating expression: =getdirectgroupmemberuserspaging(tointeger("IESO Adequacy Administrator"),0,20) (Expression evaluation error at function &#x27;getdirectgroupmemberuserspaging&#x27;: Error evaluating function &#x27;getdirectgroupmemberuserspaging&#x27; : Null argument not allowed) (Data Inputs)
  • 0
    A Score Level 1
    in reply to garym

    @gary - You need to retrieve the group Id first, for which I have already mentioned the function getgroupbyname(). This also comes from the same Shared Component.

    The expression - tointeger("IESO Adequacy Administrator") - is returning null (Please refer to the attachment) because the function tointeger() cannot parse the string that you have passed as group and so the main function getdirectgroupmemberuserspaging() is throwing a Null Pointer Exception. Hope this is clear.

    You need to write something like this:

    getdirectgroupmemberuserspaging(getgroupbyname("IESO Adequacy Administrator"),1,20) 

    or

    getdirectgroupmemberuserspaging(tointeger(getgroupbyname("IESO Adequacy Administrator")),1,20).

    Give it a try and let me know if this doesn't work for you.

Reply
  • 0
    A Score Level 1
    in reply to garym

    @gary - You need to retrieve the group Id first, for which I have already mentioned the function getgroupbyname(). This also comes from the same Shared Component.

    The expression - tointeger("IESO Adequacy Administrator") - is returning null (Please refer to the attachment) because the function tointeger() cannot parse the string that you have passed as group and so the main function getdirectgroupmemberuserspaging() is throwing a Null Pointer Exception. Hope this is clear.

    You need to write something like this:

    getdirectgroupmemberuserspaging(getgroupbyname("IESO Adequacy Administrator"),1,20) 

    or

    getdirectgroupmemberuserspaging(tointeger(getgroupbyname("IESO Adequacy Administrator")),1,20).

    Give it a try and let me know if this doesn't work for you.

Children