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
7 replies
Subscribers
7 subscribers
Views
2352 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
User Interface
rule!xyz: if(origcdt.firstname = changecdt.firstname, {},"firstname compare
jegadeeswaran
over 9 years ago
rule!xyz: if(origcdt.firstname = changecdt.firstname, {},"firstname compare fail")
rule!xyz(origcdt, changecdt)
origcdtList: {origcdt1,origcdt2,origcdt3}
changecdtList: {changecdt1,changecdt2,changecdt3}
Below rule:
apply(rule!xyz, merge(origcdtlist,changecdtlist))
Am not getting expected result. Please assist on this and did anyone faced the simillar issue.
OriginalPostID-144083
OriginalPostID-144083
Discussion posts and replies are publicly visible
0
shivakanthr
over 9 years ago
1. What is the rule input type. It should be of type any type.
2. Instead of passing cdt directly to the rule, pass CDt1.first name,CDT2.firstname
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
sachinr
over 9 years ago
you should use "ri!" (for rule input variables) or "local!" (for rule local variables) as prefix to every variable as per variable type.
eg: apply(rule!xyz, merge(ri!origcdtlist,ri!changecdtlist)) if origcdtlist and changecdtlist are rule inputs.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
PhilB
A Score Level 1
over 9 years ago
It's worth knowing that plain text comparisons executing in the expression editor may give a different result to those executing in process as they may or may not be case sensitive.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Conor Cahill
Certified Lead Developer
over 9 years ago
I would use fn!exact() to compare the strings. What is the result you are getting?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
jegadeeswaran
over 9 years ago
Hi Conorc, Need to compare multiple fields in CDT. I got the error like "Invalid Array"as it is not possible to merge cdt using fn!merge. I tried below one and it fixed my issue apply(rule!xyz, 1+enumerate(length(ri!changecdt),ri!changecdt,ri!origcdt).
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
PhilB
A Score Level 1
over 9 years ago
It would have been simpler to have a rule with inputs of origFirstName and changedLastName, and then do something like apply(fn!xyz,merge(origCdt.firstName,changeCdt.firstName)) - assuming the arrays are the same length.
I suggest you read the documentation carefully for fn!merge (it doesn't simply append the arrays together) - as well as for fn!apply, giving particular attention to the difference between the array and context inputs.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
shivakanthr
over 9 years ago
In rule use underscore like below.
Apply(rule!xyz(_,_),merge(input1,input2))
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel