Tool Mastery

Explore a diverse compilation of articles that take an in-depth look at Designer tools.
Become a Tool Master

Learn how you can share your expertise with the Community

LEARN MORE

Tool Mastery | Auto Field

MattD
Alteryx Alumni (Retired)
Created
Auto Field.png

This article is part of the Tool Mastery Series, a compilation of Knowledge Base contributions to introduce diverse working examples for Designer Tools. Here we’ll delve into uses of the Auto Field Tool on our way to mastering the Alteryx Designer:

The Auto Field Tool: a tool so easy you don’t have to do anything – just put it on your canvas and viola. Automatically optimized data types. If you’re running into data type related issues and errors in your workflows, or just looking to add some speed or reduce the occupied disk space your data is hoarding – look no further than the Preparation Tool Category’s Auto Field Tool, which reads through all the records of an input and sets the field type to the smallest possible size relative to the data contained within the column. Use it to:

Join Error.jpg

"String Fields can only be joined to other string fields."

Sick of this error?

Quickly normalize the data you're joining on with the Auto Field Tool.

Before Joins.jpg

  • Before formulas to get to expected data types (example attached in Auto Field.yxzp):

Formula Error.jpg

"Parse Error at char(#): Formula: invalid type in subtraction operation (Expression ##)"

What about errors like this one?

Our best guess is that you were performing formula logic on a data type thinking it was a different type than what it's currently captured in the Designer as. Since the Auto Field Tool is pretty good at guessing the most intuitive types to each column in a data set, use it toeffortlessly update those types and move on with the rest of your analyses!

Before Formulas.jpg

If you're more old school, or you just prefer to keep the data type as in, feel free to work around these quick data type changes in your formula with the tostring() and tonumber() conversion functions.

  • Before writing to database to optimize table size and field types:

Simply add the Auto Field Tool just before you write to your output - it will reduce the size of your table to Alteryx's automatically assigned most efficient data types. Your database administrator will thank you later!

Too easy.gif

If the Auto Field Tool is just too easy for you - be sure to check out the Select Tool to assign your own data types with more detail! You can master it here.

By now, you should have expert-level proficiency with the Auto Field Tool! If you can think of a use case we left out, feel free to use the comments section below! Consider yourself a Tool Master already? Let us know at community@alteryx.com if you’d like your creative tool uses to be featured in the Tool Mastery Series.

Stay tuned with our latest posts every #ToolTuesdayby following @alteryxon Twitter! If you want to master all the Designer tools, consider subscribingfor email notifications.

Attachments
Comments
nidhisagar
5 - Atom

Hi,

I am unsure about the usefulness of Auto field in reusable workflows - where the input data will be refreshed on a regular basis. If we have a select tool after the Auto field, I have noticed that at times the Select tool keep sticking to the length that was passed on to it by Auto field in the first execution. This results in truncation on subsequent runs if the string length of data has increased.

 

Any thoughts or solutions?

razzy
8 - Asteroid

Can someone please help me moving forward with configuring the data download tool for this space , it is not giving me the option to enter anything.

 

 

ignas
8 - Asteroid

I have exactly the same concern. Does anybody have any thoughts on this?

Archaeopteryx
10 - Fireball

So when I insert this into a previously created workflow just before a join, I actually get the errors this tool is supposed to eliminate. 

Campbellj2
5 - Atom

Possible same issue along the lines of what nidhisagar posted - we are experiencing issues where using auto field is adding trailing spaces to the data itself - has anyone ran into this as well?