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
5 replies
Subscribers
7 subscribers
Views
3555 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
AI and Rules
If I have a CDT is there any way for me to list out each of its fields by name d
robbier
over 9 years ago
If I have a CDT is there any way for me to list out each of its fields by name dynamically? I was playing around with some of the functions but haven't seen anything yet.
OriginalPostID-166634
OriginalPostID-166634
Discussion posts and replies are publicly visible
Parents
0
Jin Pheh
Certified Associate Developer
over 9 years ago
I've actually written a rule to do exactly this for debugging and I think it's output is a little easier on the eyes. If you toss the below into an interface rule you can pass it any object or array and it will tell you the number of items, the item type and break out all of the fields and their values in an easy to read format. I find it particularly helpful when debugging issues related to single element arrays vs single objects. Note that it doesn't handle nested CDTs very well.
a!paragraphField(
label: "Details: " & rule!lengthNullSafe(ri!object) & " x " & typename(typeof(ri!object)),
value: joinarray(split(joinarray(split(tostring(ri!object), ","), char(10)), "; "), char(10) & char(10)),
readOnly: true()
)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Reply
0
Jin Pheh
Certified Associate Developer
over 9 years ago
I've actually written a rule to do exactly this for debugging and I think it's output is a little easier on the eyes. If you toss the below into an interface rule you can pass it any object or array and it will tell you the number of items, the item type and break out all of the fields and their values in an easy to read format. I find it particularly helpful when debugging issues related to single element arrays vs single objects. Note that it doesn't handle nested CDTs very well.
a!paragraphField(
label: "Details: " & rule!lengthNullSafe(ri!object) & " x " & typename(typeof(ri!object)),
value: joinarray(split(joinarray(split(tostring(ri!object), ","), char(10)), "; "), char(10) & char(10)),
readOnly: true()
)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Children
No Data