Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Suggested Answer
+1
person also asked this
people also asked this
Replies
6 replies
Answers
1 answer
Subscribers
7 subscribers
Views
8825 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
AI and Rules
Does anyone know of a way to set a dynamic field on a CDT? For exam
Jin Pheh
Certified Associate Developer
over 8 years ago
Does anyone know of a way to set a dynamic field on a CDT?
For example if the name of the column is in ri!fieldName I can fetch the value using index(ri!myCDT, ri!fieldName, ""). Is there a way to set the field? IE: a version of fn!updateArray that accepts a field name as well as a numeric index?
OriginalPostID-198138
OriginalPostID-198138
Discussion posts and replies are publicly visible
Top Replies
Stefan Helzle
over 8 years ago
+2
suggested
A Score Level 3
Try this =a!fromJson(substitute(a!toJson({tzqYx62_01_:ri!value}), "tzqYx62_01_", ri!key)) It is indeed a bit tricky ....
Parents
0
Tyler Criste
Appian Employee
over 8 years ago
Jin, if you're in a SAIL form you should be able to save the value using ri!myCdt[ri!fieldName]. ri!myCdt[ri!fieldName][ri!index] should work too.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Reply
0
Tyler Criste
Appian Employee
over 8 years ago
Jin, if you're in a SAIL form you should be able to save the value using ri!myCdt[ri!fieldName]. ri!myCdt[ri!fieldName][ri!index] should work too.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Children
0
hiteshd
Certified Lead Developer
over 6 years ago
in reply to
Tyler Criste
Hi Tyler, Could you please elaborate with an example for the approach you suggested earlier?
Thanks.
Hitesh
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
sureshg57
over 6 years ago
in reply to
hiteshd
Why not utilise the CDT Manipulation plugin to achieve this behaviour. you will have updateCDT function in that.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
davel001150
Certified Lead Developer
over 6 years ago
in reply to
sureshg57
updateArray(yourCDT.fieldname, ri!indexYouWantToAlter, ri!newValue)
yourCDT.fieldName returns an array of the same type as fieldName (for instance an array of strings or an array of DateTime), with count equal to count of yourCDT
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel