@JPollet have you considered along the lines of the suggestions from @MartinDDDD to extract the table specs and then filter if a Column of that name is present?
Then you determine which port to use and put that into a CASE SWITCH construct
Then you collect the correct branch in the end: