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
17 replies
Subscribers
7 subscribers
Views
5531 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
AI and Rules
I am working on report which displays list of users and associated role. I am ab
vineeta6579
over 9 years ago
I am working on report which displays list of users and associated role. I am able to get custom group id in grid. But when i am converting the customer group id to group name, for some of group its working but for other it gives blank result.
I am using below code to get convert group id to group name.
a!gridTextColumn(label:"Groups Id",field:"",data:local!totalgroupNumbersList),
a!gridTextColumn(label:"Groups List",field:"",data:getgroupnames(apply(togroup(_),local!totalgroupNumbersList)))
OriginalPostID-144869
OriginalPostID-144869
Discussion posts and replies are publicly visible
0
Conor Cahill
Certified Lead Developer
over 9 years ago
I think what is happening is the getgroupnames() rule is returning a list of unique groups, and since you have duplicates in your first column, the second column will have fewer values.
You should make a subrule that takes a group id and returns the group name, and then apply over that rule, feeding it each group id.
subrule:
=getgroupnames(togroup(ri!groupid))
main rule:
data: apply(rule!yourSubRule(_), local!totalgroupNumbersList)
Try that and see if it works / what happens when you use it.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
vineeta6579
over 9 years ago
same output!!!
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
ashish.deshmukh
A Score Level 1
over 9 years ago
nstead of getgroupbynames try using group function to fetch the group name in above rule.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
vineeta6579
over 9 years ago
Getting same error using group function !!
=group(togroup(ri!groupid),"groupName")
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
sikhivahans
over 9 years ago
@vahluwalia Hi, try using this code snippet. Hope it helps!!
Name:
rule!someRuleName
Inputs:
1. group (Group)
Definition:
if(
\trule!APN_isBlank(ri!group),
\tnull,
\tif(
\ tdoesgroupexist(
\ t tointeger(
\ tri!group
\ t )
\ t),
\ tgetgroupnames(
\ t tointeger(
\ tri!group
\ t )
\ t),
\ tnull
\t)
)
a!gridTextColumn(label:"Groups List",field:"",data:apply(rule!someRuleName(group:_),local!totalgroupNumbersList))
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
vineeta6579
over 9 years ago
doesgroupexist function is not available in my Cloud instance.. I have checked individual some of group ids which were not displayed under group name column, they
do exist in the system.
Any other pointer!!!
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
sikhivahans
over 9 years ago
doesgroupexist is a safe way of handling nonexistent(probably because of deletion) groups. If you are sure that all the groups exist in your system, then ignore the usage of 'doesgroupexist' function.
if(
rule!APN_isBlank(ri!group),
null,
getgroupnames(
tointeger(
ri!group
)
)
)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
vineeta6579
over 9 years ago
Not working..
Groups are present in system, I tested using same rule only & got correct output.
But When I am using same rule from report its not returning all group name..
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
sikhivahans
over 9 years ago
@vahluwalia Could you please attach the code snippet you are using to render the grid?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
vineeta6579
over 9 years ago
@sikhivahans, I have attached the report code and report image.
You need to assign CONS_FMS_CI_GroupType to yours local system group type value.
Let me know if something else is required..
ReportCode
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
>