process nodes on existence of the column

Hi,

I need to process a CSV file having variable list of columns , in few scenarios , not all columns are sent in the CSV file , which node can help me validate to proceed with furthering of the nodes only if the respective column is present. The column names in the CSV file are fixed. For example if the column headers in the CSV are : Data_US, DATA_FR, DATA_CZ, DATA_NB , DATA_CZ . I have specific processing to be done for each column . If only DATA_US and DATA_NB are present in the CSV file , only then the nodes having processing for DATA_US and DATA_NB should be processed. How can I add check before column filter to validate existence of the columns .

Tried Extract Table Spec along with Rule Engine, but cannot find way disable execution of nodes if the column is not present

Appreciate help on the above

Regards,
Nivedita

Hi @nivedita_dixit

See this wf process_column_if_exist.knwf (79.1 KB). It has a seperate branch for every possible column in your csv. The branches are activated by a switch. Every row has its own switch-id. Only the switches from columns that are in the actual input cvs are activated. Hope this helps!?

gr. Hans

4 Likes

Hi @HansS , Thanks a lot for the flow. I have a complex manipulation branch for each column , but seems like your solution will work . Will validate on extending the flow shared by you .

Regards,
Nivedita

1 Like

Hi @HansS , Thanks a lot. The solution shared by you worked for me .

Regards,
Nivedita

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.