Skip to main content
Solved

Parameters in stream selector stage

  • April 19, 2024
  • 2 replies
  • 81 views

Hi,

In my pipeline, I am having a stream selector stage. I want to parameterize it and use the following expression for the condition:

${record:value('/rating_text') == '${pipeline_rating_text}'}

Here, pipeline_rating_text is my parameter that I have defined for my pipeline. The problem is that when I run the pipeline it does not work. If I use this expression 

${record:value('/rating_text') == 'Excellent'}

everything will be fine. 

Can somebody help me, please?

Best answer by sam

Expression language wrappers don’t nest. Instead, anything inside the ${} will be treated as a variable unless it is quoted. So what you want is

${record:value('/rating_text') == pipeline_rating_text}

2 replies

Forum|alt.badge.img
  • StreamSets Employee
  • Answer
  • April 19, 2024

Expression language wrappers don’t nest. Instead, anything inside the ${} will be treated as a variable unless it is quoted. So what you want is

${record:value('/rating_text') == pipeline_rating_text}


  • Author
  • Roadie
  • April 19, 2024

Thanks for the answer :)

I tried this as well earlier, but it seemed like it was not working.Turns out that the problem was that my parameter ended up being defined with some trailing spaces. I have resolved the problem now.