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
3520 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
AI and Rules
Hi there, Try to achieve: Compare individual attributes value within
henryd
over 10 years ago
Hi there,
Try to achieve:
Compare individual attributes value within same element between two CDT instances. For example, CDT[1].field1=CDT[2].field1 AND CDT[1].field2=CDT[2].field2 AND CDT[1].field3=CDT[1].field3 AND ...
Method has been Tried:
Use tostring to convert CDT into mutiple values text PV array via striping off "[,]" and splitting with ",". It returns as an array of {field1=value1,field2=value2,field3=value3....}. Use text set function to find out the diffence array of two CDT instances.
Problem:
It will break into unexpected extra CDT elements when there is/are one or more "," (comma) characters within CDT element values.
Appian Version: 7.6;
Help please:
Are there any other ways to achieve this?
Many thanks/Henry...
OriginalPostID-121643
OriginalPostID-121643
Discussion posts and replies are publicly visible
Top Replies
henryd
over 10 years ago
+1
Sorry for late response. It works using straight comparison: if cdt[1]=cdt[2] if you find if cdt level value changed. The inital proposal of my post works well if there are no any CDT attribute contains…
0
Tim
Certified Lead Developer
over 10 years ago
Have you tried the default AND() function? What is it you are trying to achieve?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
henryd
over 10 years ago
Hi Tim,
I am trying to track if any elemet values of CDT changed after numbers of processes executed. At end of process, I would find out that if I need to update database with this CDT if any of its element values have been changed, otherwise, do not update database. I was not sure that there is a generic straight way to do this: CDT[1]=CDT[2] comparison.
Thanks/Henry
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Tim
Certified Lead Developer
over 10 years ago
Hi Henry, it does look like this is possible:
=with(
local!cdt: {{id:1, desc: "A"}, {id:1, desc: "B"}},
a!textField(
value: local!cdt[1]=local!cdt[2]
)
)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
jegadeeswaran
over 10 years ago
Hi Tim, Did you achieve your expected result if so could you please share how you did it... I do have same requirement.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
jegadeeswaran
over 10 years ago
Henry... Please share the solution if you got one.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
stephanek
over 10 years ago
Hi henryd , can you suggest me how you solve this ? it might help me in solving a requirement i have. thanks
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
mohammads
Certified Senior Developer
over 10 years ago
You can utilize difference() function (
forum.appian.com/.../Set_Functions.html
to compare CDTs. Just adding if some one lands here for solution.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
henryd
over 10 years ago
Sorry for late response.
It works using straight comparison: if cdt[1]=cdt[2] if you find if cdt level value changed.
The inital proposal of my post works well if there are no any CDT attribute contains wiht comma (",") characters since it will mismatch numbers of attributes between CDT instances. So, I still don't find ideal solution for my requirement.
Thanks/Henry
Cancel
Vote Up
+1
Vote Down
Sign in to reply
Verify Answer
Cancel