Dev Space

Customize and extend the power of Alteryx with SDKs, APIs, custom tools, and more.
SOLVED

Python SDK : Retrieve field information in metadata object

evad
5 - Atom

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 

2 REPLIES 2
RafaelH
Alteryx Alumni (Retired)

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!

evad
5 - Atom

Thanks for the tip.

 

indeed it helped me.

 

Regards,

David