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!
Solved! Go to Solution.
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.
Hope this helps!
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:
We then use the Field Info tool which essentially gives us the metadata of our dataset:
Next, we create a concatenated list of all of the fields present (which sit in the [Name] column of this output):
Now we can just append this to the main data set and conduct a filter based on our target field sitting within this list:
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.
Thanks a bunch, I was almost there, but you just helped me get there.