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.

  • @poorna - OK I see now. Thanks. For the batchSize parameter, does it matter if I put a high number such as 30 or 50. I don&#x27;t expect the results set to be too high but there may be the occasional group that has a lot of members so if I put 30 and there happened to be 31 members, I&#x27;m assuming it will truncate the last member.
  • 0
    A Score Level 1
    in reply to garym
    @gary - Yes, your assumption is correct. The Start Index and Batch Size parameters are to define the lower and upper limits of the Result-set which need to be fetched. So please make sure the batch size value will cover the count of the result set if it is not very huge and if it is huge fetch the data in a batch manner by manipulating the above 2 parameters to cover the entire result set.
Reply
  • 0
    A Score Level 1
    in reply to garym
    @gary - Yes, your assumption is correct. The Start Index and Batch Size parameters are to define the lower and upper limits of the Result-set which need to be fetched. So please make sure the batch size value will cover the count of the result set if it is not very huge and if it is huge fetch the data in a batch manner by manipulating the above 2 parameters to cover the entire result set.
Children
No Data