Skip to main content

Field Python Class

Important

This Python SDK uses outdated technology that limits your extension opportunities. We've built a new Platform SDK using Python and the latest open-source technology to deliver a vastly improved development experience. Go to Platform SDK to get started!

The Field class is provided as a reference class to extend the class members of a Field object instantiated within the running Alteryx process. Use the methods in the Field class to impact field types and metadata.

Field Types

This is a list of the field types recognized by the Alteryx Engine:

binary

boolean

numeric

byte, int16, int32, int64, fixeddecimal, float, double

fixeddecimal requires both size and scale. See Data Types for more information about fixed decimal in Alteryx.Data Types

string

string, wstring, v string, v_wstring

date/time

date, time, datetime

The format for these types is YYYY-MM-DD HH:mm:SS.

spatial

spatial object

blob

blob

Read-Only Field Attributes

description: The description of the field.

max_bytes: The maximum number of bytes a variable-length field can hold.

name: The name of the field.

offset: The offset of the field.

position: The 0-based index of the field in its parent RecordInfo.

scale: The scale of the field.

size: The size of the field in bytes.

source: The source of the field.

type: The type of the field.

Methods

equal_type

equal_type((Field)other_field) -> bool :

Returns true if the other_field argument has the same type, size, and scale as this field.

get_as_bool

get_as_bool((RecordRef)record) -> object :

Returns the value of this field in the specified record as a boolean value.

get_as_double

get_as_double((RecordRef)record) -> object :

Returns the value of this field in the specified record as a double value.

get_as_int32

get_as_int32((RecordRef)record) -> object :

Returns the value of this field in the specified record as an int32 value.

get_as_int64

get_as_int64((RecordRef)record) -> object :

Returns the value of this field in the specified record as an int64 value.

get_as_string

get_as_string((RecordRef)record) -> object :

Returns the value of this field in the specified record as a string value.

get_as_blob

get_as_blob(RecordRef)record) -> object :

Returns the value of this field in the specified record as a blob value.

get_null

get_null((RecordRef)record) -> bool :

Returns true if the value of this field in the specified record is [Null].

set_from_bool

set_from_bool((RecordCreator)record_creator, (bool)value) -> None :

Sets the value of this field in the specified record_creator from a boolean value.

set_from_double

set_from_double((RecordCreator)record_creator, (float)value) -> None :

Sets the value of this field in the specified record_creator from a double value.

set_from_int32

set_from_int32((RecordCreator)record_creator, (int)value) -> None :

Sets the value of this field in the specified record_creator from an int32 value.

set_from_int64

set_from_int64((RecordCreator)record_creator, (int)value) -> None :

Sets the value of this field in the specified record_creator from an int64 value.

set_from_string

set_from_string((RecordCreator)record_creator, (str)value) -> None :

Sets the value of this field in the specified record_creator from a string value.

set_from_blob

set_from_blob((RecordCreator)record_creator, (blob)value) -> None :

Sets the value of this field in the specified record_creator from a string value.

set_null

set_null((RecordCreator)record_creator) -> None :

Sets the value of this field in the specified record_creator to [Null].