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
13 replies
Answers
1 answer
Subscribers
7 subscribers
Views
10918 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
AI and Rules
get List of Item from CDT
joanneh
over 7 years ago
Hello!
please may I know if there is anyway to get the list of items in a CDT?
For example, if there are 3 items namely the "id", "customerId" and "contacts" within the CDT, how could I get a list of Text containing the name of the items above (i.e. something like an array:{"id","customerId", "contacts"})?
Shall I do a queryrule or something?
Thanks for your time
OriginalPostID-238884
Discussion posts and replies are publicly visible
Parents
0
chetany
A Score Level 1
over 7 years ago
Do you want only the attributes of the CDT Type? If you want the attribute fields as well as the values, I would suggest another approach - use the a!toJson function.
Eg: If local!cdt is a CDT with data like this: {id: 1, customerId:23, contacts: {"contact1", "contact2"}} etc, you can just use a!toJson(local!cdt).
If you just want the attributes of a CDT - there is another solution:
Assume that the type of your CDT is Customer. Then you can find the attributes in the Customer CDT as follows:
fn!split(fn!stripwith(fn!tostring(type!Customer()) , "=[] "),",")
It will return all the fields in the CDT as an array
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Reply
0
chetany
A Score Level 1
over 7 years ago
Do you want only the attributes of the CDT Type? If you want the attribute fields as well as the values, I would suggest another approach - use the a!toJson function.
Eg: If local!cdt is a CDT with data like this: {id: 1, customerId:23, contacts: {"contact1", "contact2"}} etc, you can just use a!toJson(local!cdt).
If you just want the attributes of a CDT - there is another solution:
Assume that the type of your CDT is Customer. Then you can find the attributes in the Customer CDT as follows:
fn!split(fn!stripwith(fn!tostring(type!Customer()) , "=[] "),",")
It will return all the fields in the CDT as an array
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Children
No Data