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
9 subscribers
Views
3275 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
General
Hi, I need the output as an email of username. I have tried create an expre
sudhirp804
over 10 years ago
Hi,
I need the output as an email of username. I have tried create an expression rule below but getting the below error. Could anyone suggest regarding the issue in the expression rule and correct me what needs to be updated.
=if(and(not(rule!APN_isEmpty(ri!user)),isusernametaken(ri!user)),user(touser(ri!user),"firstName") & " " & user(touser(ri!user),"lastName"),"NA")
Problem: An invalid expression has been encountered in a task.
Details: ERROR:An error occurred while evaluating expression: =rule!prmFormatUserAsEmailAddress() (Expression evaluation error in rule 'prmformatuserasemailaddress': Rule 'prmformatuserasemailaddress' has 1 parameters, but instead passed 0 parameters.) (Data Inputs)
OriginalPostID-145357
OriginalPostID-145357
Discussion posts and replies are publicly visible
0
aasuliman
over 10 years ago
you must pass your parameter value when you call this rule (ri!user does not passed to the rule when you called)..
see your massage error :
Rule 'prmformatuserasemailaddress' has 1 parameters, but instead passed 0 parameters.) (Data Inputs)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
sudhirp804
over 10 years ago
Currently the model is using a PV projectmetadata to get the email address. I would like to modify this PV and instead we want to create an expression rule like prmFormatUserAsFirstLast to get the email address then we can reference the rule in the process model.
For this I have created a expression rule prmFormatUserAsFirstLast
=if(and(not(rule!APN_isEmpty(ri!user)),isusernametaken(ri!user)),user(touser(ri!user),"firstName") & " " & user(touser(ri!user),"lastName"),"NA")
but getting the error.
Could you suggest what needs to be added so that I get an email address here.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
sudhirp804
over 10 years ago
I would like to modify this PV and instead I want to create an expression rule like prmFormatUserAsFirstLast to get the email address then we can reference the rule in the process model. Could you suggest what needs to be added in expression rule so we can the email address... It would be helpful if there is any suggestion on the expression rule.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
sudhirp804
over 10 years ago
This is the expression rule I have added instead of using a process variable. rule!prmFormatUserAsFirstLast()
=if(and(not(rule!APN_isEmpty(ri!user)),isusernametaken(ri!user)),user(touser(ri!user),"firstName") & " " & user(touser(ri!user),"lastName"),"NA")
but getting the error.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
sudhirp804
over 10 years ago
Attached the expression rule
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
PhilB
A Score Level 1
over 10 years ago
if(
and(
not(
rule!APN_isEmpty(
ri!user
)
),
isusernametaken(
ri!user
)
),
user(
touser(
ri!user
),
"email"
),
"NA"
)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
PhilB
A Score Level 1
over 10 years ago
I would also suggest that in this and your previous rules, the touser() is redundant as you're already passing in a user object.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
sudhirp804
over 10 years ago
Thx Philb ... I have update expression and process mode. It is working now. rule!prmemailaddress ---> =if(and(not(rule!APN_isEmpty(ri!user)),
isusernametaken(ri!user)),
user(touser(ri!user),"email"),"NA")
=rule!prmemailaddress(pv!projectMetadata.projectInitiator)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel