Checking for existance of a column?

I think I saw a similar post somewhere but can't find it, sorry for double post in that case -

how would I go about to check if a table (specifically from input file) contains certain columns or not? By reading the column names and comparing to a string? There might be cases where some columns aren't there to begin with, what then?


Extract Column Header > Transpose will give you a nice small table of column names that you can "check".  The checking could be done in several ways (for example, with a rule based row filter and an empty table switch).  

I found something called "Extract Table Spec" but in the end it's as as you suggest, using rules. Haven't found a better way and it's not very flexible (say there are 5 different ways of writing a certain header, you cover those, then suddenly there is a 6th or 10th way of it in the input file).

I think you meant a post from me and I can suggest 2 simple solutions:

If you have a few fixed columns use the column selection quick forms where user can select the appropriate columns. Then use column Rename Node to rename the selected columns into the correct name.

The other option is to define a fixed template, verify any uploaded file against it (eg. column count and column names) and if wrong the workflow just fail.



ok, thanks. I will try that.