Skip to main content
Question

Trigger a Reader only if condition is met

  • November 3, 2022
  • 4 replies
  • 174 views

robertr
Contributor
Forum|alt.badge.img+6

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

david_r
Celebrity
  • November 3, 2022

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.


f.kemminje
Contributor
Forum|alt.badge.img+11
  • Contributor
  • November 3, 2022

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

here is the w bench file

 


robertr
Contributor
Forum|alt.badge.img+6
  • Author
  • Contributor
  • November 3, 2022
f.kemminje wrote:

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.


robertr
Contributor
Forum|alt.badge.img+6
  • Author
  • Contributor
  • November 3, 2022
david_r wrote:

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.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings