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
8 replies
Subscribers
8 subscribers
Views
3645 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
AI and Rules
Hi guys, I'm trying to create an expression to retrieve group id
fredericom
over 9 years ago
Hi guys,
I'm trying to create an expression to retrieve group id by name group, using the function "getgroupbyname()". However, i want to apply this function for multiple groups and from the plugin's description this function only receive one group as parameter. How i can apply this function for multiple groups? I realize that "apply()" function is a good alternative but i don't understand the syntax quite as well. Can anyone give me some guidelines?
Best Regards
OriginalPostID-177674
OriginalPostID-177674
Discussion posts and replies are publicly visible
Top Replies
GouthamKrishna
over 9 years ago
+1
This is called "Partial Evaluation" of rules/functions.. This is useful when you don't want to supply every rule parameter at design time OR when the rule should iterate over multiple arguments. An "_…
0
Rahul Gundu
over 9 years ago
Try the below code.
apply(
fn!getgroupbyname(groupName:_),
{ri!arrayofgroupNames}
)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Sandeep Deshmukh
over 9 years ago
Hi fredericom,
try this
apply(getgroupbyname(groupName:_),{"Group1","Group2"})
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
fredericom
over 9 years ago
@rahulg262 and @sandeepd thanks for your suggestions. I already tried and it worked :)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
fredericom
over 9 years ago
One more question: can you explain to me why you used this format "groupName:_" for function parameter
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
sanjeetg
over 9 years ago
Try apply(fn!getgroupbyname,cons!allGroupNames)
The constant could be replaced by any variable such as a Process Variable or Rule Input which contains all your group names.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
nageswararaoa
over 9 years ago
forum.appian.com/.../Looping_Functions.html
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
GouthamKrishna
over 9 years ago
This is called "Partial Evaluation" of rules/functions.. This is useful when you don't want to supply every rule parameter at design time OR when the rule should iterate over multiple arguments. An "_(underscore)" placed in the list of parameters for a rule is called a placeholder for that parameter and its not necessary when the rule has only one parameter. In case it has multiple parameters then you can specify values for some parameters and while leaving others using '_'. Values for these placeholder parameters are provided at run time from with in the list of values you specify in an apply() function. See the following documentation.
forum.appian.com/.../Expressions.html
Cancel
Vote Up
+1
Vote Down
Sign in to reply
Verify Answer
Cancel
0
fredericom
over 9 years ago
Thank you guys :)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel