Alteryx Designer Knowledge Base

Definitive answers from Designer experts.
It's the most wonderful time of the year - Santalytics 2020 is here! This year, Santa's workshop needs the help of the Alteryx Community to help get back on track, so head over to the Group Hub for all the info to get started!

How To: Manage Metadata in the Python tool

Alteryx Alumni (Retired)

How To: Manage Metadata in the Python tool


Starting with Alteryx Designer 2018.4, the Python tool can now read and write metadata for better communication with the rest of the workflow. This is accomplished using two functions included in the ayx Python library; readMetadata() and write() with the argument columns=. Like other functions related to input/output, one needs to run the workflow first in order to access data.

Remark: with 2018.4, metadata field description could not be retrieved or modified.




  • Alteryx Designer ≥ 2018.4 


Procedure: Reading Metadata


1. Load module Alteryx from package ayx.

from ayx import Alteryx


2. Load input metadata with function readMetadata, specifying the input name as the argument.

#this example reads the connected input #1


In this example, we use the data set found under %ALTERYX_DIRECTORY%\Samples\en\SampleData\





Procedure: Writing Metadata


1. Load module Alteryx from package ayx.


from ayx import Alteryx


2. Describe the metadata using the following format:


new_metadata = {'PRMSIC' : {'type' : ' Int64'}}



{ '%COLUMN NAME%' : { 'type': '%ALTERYX DATATYPE%', 'length': %DATATYPE LENGTH%, 'source': '%DATATYPE SOURCE%', 'description': '%DATATYPE DESCRIPTION%'  } }

Where : 


%COLUMN NAME% : Column to change (case insensitive).

%ALTERYX DATATYPE% : One of the Alteryx Designer datatypes.

%DATATYPE LENGTH% : Size of the field (integer or float for Fixed Decimal of the field (note that it is called size in result window and length here)). Length is mandatory for string datatypes and optional otherwise.

%DATATYPE SOURCE% : Source of Alteryx data (default value: PythonTool:)

%DATATYPE DESCRIPTION% : Free field to comment field (default value: empty)


3. Write the data out with the defined metadata.

#this example writes out to output anchor 1





8 - Asteroid

Just a quick addition: you need to run the entire workflow (not just the jupyter notebook) before attempting 




 or else Alteryx will look for the connection in \AppData\Local\Temp

Alteryx Alumni (Retired)

Hi @nakamott,


Thanks for the comment! Post will be updated accordingly.

You are correct: one needs to run the workflow first, in order to be able to access tool input/output details. Temporary data and Jupyter notebook will be stored in engine temporary path for the time of the Designer session.

Note that further details could be obtained when debug parameter is set to True.








Paul Noirel

Sr Customer Support Engineer, Alteryx