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
6 replies
Subscribers
8 subscribers
Views
2476 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
AI and Rules
I am creating a rule which takes two input, username and RoleCount. If the Rolec
vineeta6579
over 10 years ago
I am creating a rule which takes two input, username and RoleCount. If the Rolecount is 2 and username abc, I want to get abc,abc in output.
I am getting below error while testing rule. Any pointer ...
Error :- Expression evaluation error at function fn!apply: A rule or function reference is expected as the 1st parameter.
OriginalPostID-143851
OriginalPostID-143851
Discussion posts and replies are publicly visible
0
Jin Pheh
Certified Associate Developer
over 10 years ago
What about the fn!repeat function? ie:
fn!repeat(ri!RoleCount, ri!username)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
vineeta6579
over 10 years ago
It works.. Any idea why my code does't work
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Tim
Certified Lead Developer
over 10 years ago
As the error explains the 1st input to apply() must be a rule or function not simply a variable. Check out the docs
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Jin Pheh
Certified Associate Developer
over 10 years ago
The apply function takes a function reference and an array - you've provided a user object and an array - ie the wrong parameter types.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
vineeta6579
over 10 years ago
I got same error for the below code also.
fn!apply(fn!append({},ri!username),enumerate(ri!RoleCount))
Also tried by creating separate rule for fn!append({},ri!username)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Tim
Certified Lead Developer
over 10 years ago
Start here:
forum.appian.com/.../Looping_Functions.html
And also check out partial evaluation here:
forum.appian.com/.../Function_Recipes.html
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel