Question

Trigger a Reader only if condition is met

  • 3 November 2022
  • 4 replies
  • 28 views

Badge +2

Hello,

I have a workbench that checks several files for some data mergers. Problem is, this one source I have (30+ excel files with thousand of rows each) is useful only when there is a certain value in one of the columns.

 

I was wondering if there is a way to open these files only if a condition is met beforehand (like a user parameter prompt). I wouldn't want to read all files every time knowing that if the condition is not met, they won't bring any value to the end result.

 

For example, If I chose at the start of the workbench "Toronto" - it should trigger this reader; if I chose some other city, it shouldn't.

 

Any advice is appreciated. Thanks!


4 replies

Userlevel 4

Using a FeatureReader transformer rather than the "classic" reader will allow you to do some pre-processing and decide whether to trigger it or not.

Badge +3

As David said, you can test the user parameter value, and if satisfied, then read excel.

here is the w bench file

 

Badge +2

As David said, you can test the user parameter value, and if satisfied, then read excel.

here is the w bench file

 

thank you @f.kemminje​ - really easy to follow and implement.

Badge +2

Using a FeatureReader transformer rather than the "classic" reader will allow you to do some pre-processing and decide whether to trigger it or not.

thank you @david_r​ 

I don't know how I did not think of this. Much appreciated.

Reply