SOLVED
Python SDK : Retrieve field information in metadata object
Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Printer Friendly Page
evad
5 - Atom
‎05-10-2018
07:35 AM
- Mark as New
- Subscribe to RSS Feed
- Permalink
Hi,
I'm using Python SDK, and I'm trying to retrieve Field information from metadata object in method:
ii_init(self, record_info_in: object) -> bool:
record_info_in[0] : return a AlteryxPythonSDK.Field object
but I do not know how to access to the name of the field for example, and other information (like type of data ?)
my goal is to retrieve the column names of object passed to my plugin.
I did not find an example how to manipulate Field object in Python SDK samples.
is there other solution ?
Thank you
Solved! Go to Solution.
Labels:
- Labels:
- Python
2 REPLIES 2
RafaelH
Alteryx Alumni (Retired)
‎05-10-2018
09:05 AM
- Mark as New
- Subscribe to RSS Feed
- Permalink
The available data descriptors of the Field class can be found via:
help(AlteryxPythonSDK.Field)
You can access the data descriptor of a field of record_info_in via index:
record_info_in[field_index].name # for name of a field record_info_in[field_index].type # for type of a field
I hope this helps!
‎05-10-2018
09:12 AM
- Mark as New
- Subscribe to RSS Feed
- Permalink
Thanks for the tip.
indeed it helped me.
Regards,
David
