Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
11 replies
Subscribers
7 subscribers
Views
3594 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
AI and Rules
Hello, I am using Appian Function 'getdirectgroupmemberuserspagin
tapans
over 8 years ago
Hello,
I am using Appian Function 'getdirectgroupmemberuserspaging()' - to get the direct members of the given group (which ignores members from child group).
I found some discrepancies using this function, as it is not giving correct result sometimes. Seems the result is inconsistent using this function.
Does anyone face similar issue or have anything more to share here?
Many Thanks,
Tapan Shah
OriginalPostID-169542
OriginalPostID-169542
Discussion posts and replies are publicly visible
0
PhilB
A Score Level 1
over 8 years ago
Could you accurately describe the inconsistencies you're seeing?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
tapans
over 8 years ago
Thanks Phil for your interest!
Simple Example:
--------------------
I have created new group called : 'Tapan Test 092815'
I have added two user to that group named : 'Tapan Shah' and 'Ilian Dezoy'
Actual Outcome :When I use below function, I am getting false result for 'Ilian Dezoy'
Expected Outcome: Result should be true for both users and false for any other user who is not part of that group
Function : contains(getdirectgroupmemberuserspaging(ri!group,1,-1),ri!user)
Let me know if you need any more info.
-Tapan
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
PhilB
A Score Level 1
over 8 years ago
I see something similar but it appears to be for certain users - try removing the contains() and look at the list of group members that are being returned; some are missing.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
chetany
A Score Level 1
over 8 years ago
Hey Tapan, I just want to mention that the function getdirectgroupmemberuserspaging returns only the immediate users of that group i.e the users who were added directly in that group. It will not return users who got membership of that group because of a subgroup within that group. Also, It will not return any group administrators of that group. It will only return members who are not administrators. Another point to note is that If the group privacy is High, the function will not return members unless you are an admin.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
sikhivahans
over 8 years ago
@tapans The actual problem here is, the start index starts at 0 and you are giving a value of 1. To the best of my knowledge, contains(getdirectgroupmemberuserspaging(ri!group,0,-1),ri!user) should resolve the issue.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
PhilB
A Score Level 1
over 8 years ago
@Sikhi beat me to it! Doesn't seem to be documented but the pagingInfo isn't consistent with the normal a!pagingInfo - it's zero-indexed.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
tapans
over 8 years ago
Good catch. Thank you guys! The problem has been shorted out by changing the pagination from 1 to 0.
Thanks a lot!
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
sikhivahans
over 8 years ago
@philb Correct, but as you know already, in Appian we conclude the behavior after analysing the results of implementation. :)
@tapans To my knowledge, it seems like the API function getMemberUsersDirectPaging() in 'GroupService' interface which was used, expects the value from 0 as the array index in java start from 0 and there isn't any additional logic in plugin to make the startIndex (0) expected by API function getMemberUsersDirectPaging() inline with Appian's default startIndex(1). Offcourse, by slightly extending the getdirectgroupmemberuserspaging() function in the plugin, it can be doable.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
PhilB
A Score Level 1
over 8 years ago
@Sikhi Quite right! It'd be nice if the plugin accepted an a!pagingInfo() type but I guess it was written well before a!pagingInfo even existed!
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Chris
over 8 years ago
Also note the function getAdminUsersPaging() is zero-indexed as well, if you are using other functions in this realm, the one in the initial post is not the only one zero-indexed.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
>