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
3596 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
General
Hi All, Is there any way to retrieve the fields of CDT and store in a varia
Amit Mishra
over 7 years ago
Hi All,
Is there any way to retrieve the fields of CDT and store in a variable (multiple type)? Scenario: I have to fetch all the fields of CDT (like- EmpId, EmpName, DOJ etc.) and showed them in a drop down options of a form interface.
OriginalPostID-221269
OriginalPostID-221269
Discussion posts and replies are publicly visible
0
Jacob Cohen - Project Leader - Macedon Technologies
over 7 years ago
index(ri!cdt, "EmpId", {}) or ri!cdt.EmpId should do it.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Lakshmi Meyyappan
over 7 years ago
This post might help:
forum.appian.com/.../e-166634
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
monikar
over 7 years ago
Hi Amit
If I'm not wrong you want to get the field names of a custom data type irrespective of the CDT type. If yes, I'm not aware of any existing Appian function which provides such functionality but the generic expression given below will be helpful to get all the column names in the CDT.
load(
local!dataType: tostring(cast(typeof(ri!data), {} )),
local!columnNames: extract(local!dataType, char(44)& char(32), char(61)),
columnNames
)
Here ri!data can be of anyType to make the expression as generic.
Please let me know if I got you wrong.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Amit Mishra
over 7 years ago
You are right Monika. Thanks.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
monikar
over 7 years ago
To be specific please change the expression for local!columnNames to
apply(fn!extract(local!dataType, _, char(61)), {char(91) , char(44)& char(32)})
which gives all the column names including the primaryKey(Generally the first field in the CDT)
Hope it helps.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel