Optionally erasing some columns at the end of the component

Dear all,

I am having a simple issue that I am not able to solve.
At the end of a custom component I want to erase/not erase some columns based on user configuration.
I was able to transform the boolean configuration variable in a “top/bottom” variable for a normal if switch (see image - even if I dislike the solution… too many nodes for something which should be more straightforward) but I am still in trouble:

  1. The “End IF” node does not work because - my tables have indeed different number of columns ( indeed this is my goal :grinning: )

  2. Having two components output does not work

Any solution?

Hope it’s clear.

Ludo

@zioludo have you thought about just construction a Regular Expression with the columns you want to keep (by default= and the ones that the customers would select at the end and then just do a Column Filter?

You could also do it the other way round and allow all columns but the ones explicitly excluded.

Exclude:

^(?!(Column1|Column2)$).*$

Include

^(Column1|Column2|Column3)$

You could toy around with the settings and see explanations at:

2 Likes

Thanks a lot Markus!

I have implemented a Regex filter at the end of my component with the selection being controlled by a variable which in turn is set via a case switch controlled by the component dialog (see below).

Ludovico

immagine

1 Like

Glad it does work. You should check for some fringe cases where columns are just different by extensions _1 and the name is otherwise the same. You might have to adapt the regex

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