Error: At least one valid field must be selected

After over a year of using alteryx I came across an error that I hadn’t realised would be an error in the first place: the Auto-field tool only determines the field types of string values.

Top tip: Always look more closely at the configuration window in alteryx!

When reading in data that contains no string fields, the auto-field tool pops up with an error about needed one valid field to be selected, as well as subsequently failing to pass the data through to the following tools.

After muddling through and trying to work this out or googling I looked a little closer at the config window and realised that it only works on string fields.

If a data set, either being fed into the auto-field tool directly or within a macro, has no string fields this error will continue to pop up. You might not need the auto-field tool if you’ve just got number fields in your data set, however if the auto-field tool is within a macro that needs to be used with a variety of inputs then you may need to solve this error. An example of this is could be a macro that performs a few tests on different fields (e.g. if null, that certain fields add up to a total, date duration checks or specific lengths) from different data sets – some of which could be just numerical inputs.

A work around that I found worked, is to add a dummy string field before the auto-field tool, force it to read and pass all of the data through the field, and then delete the dummy field.

This will work even if it’s within a macro and there are different fields passing through the tools as the Dummy field remains constant and the others will all be dynamic/ unknown.

This work around helped me out so I thought I’d write a quick blog post to maybe help others out. Has anyone come across this issue before? Or solved it a different way?

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s