Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Evaluate in-expression list of field names

Diederik_vanderharst
8 - Asteroid

Hi All,

 

Does anyone know if there is code to produce a list of existing field names in the data / flow, on which I can create a boolean (if data contains 'field  x' then true)?

And anyway I can feed that boolean back into a conditional / detour?

I want to do a series of filters if I have field a,

and another series of filters if I don't.

 

I'd love to hear you suggestions!

 

Many thanks in advance!

3 REPLIES 3
gautiergodard
13 - Pulsar

Hey @Diederik_vanderharst 

I would recommend using a combination of the auto field and basic data profile tools for this.

The auto field will automatically assign the smallest data type to your fields and the basic profile tool will allow you to see the data types across all of your fields. 

gautiergodard_0-1668010798954.png

 

Hope this helps!

DataNath
17 - Castor

Hey @Diederik_vanderharst, here's one way you could think about doing this. I set up a quick example, based on creating 2 streams whether or not the [Number] field is present.

 

So we start off with our data:

 

DataNath_3-1668012148557.png

 

We then use the Field Info tool which essentially gives us the metadata of our dataset:

 

DataNath_4-1668012164948.png

 

Next, we create a concatenated list of all of the fields present (which sit in the [Name] column of this output):

 

DataNath_5-1668012175703.png

 

Now we can just append this to the main data set and conduct a filter based on our target field sitting within this list:

 

DataNath_6-1668012221725.png

DataNath_7-1668012231277.png

 

This check will either be true or false, which means your data will either come out of the top (True) anchor to be treated/filtered in one way, or the bottom (False) anchor to undergo a different process.

Diederik_vanderharst
8 - Asteroid

Thanks a bunch, I was almost there, but you just helped me get there.

Schermafbeelding 2022-11-10 om 15.24.55.png

Schermafbeelding 2022-11-10 om 15.26.28.png

Labels