Router configuration

Hi Team,

I need some help in router configuration.
I have snap execute where we select data and want to push to different target tables based on theater column.
how to put the condition
theater=‘America’ in the router.

Use two equals signs to do an equality comparison.

theater=='America'

It is throwing Error in router . I

have a select query in sql server execute

when i dont add the $ sign
record_count is undefined. Perhaps you meant: parseInt, decodeURIComponent, parseFloat, encodeURIComponent, Resolution: Please check the spelling of the variable

The $ refers to the incoming document. The error message means that one (or more) of the incoming documents doesn’t have a field called record_count. Could you look at your pipeline’s preview data and see if that field exists?

Thanks for replying.
below is my pipeline
and in the sql execute i have select count(1) as record count from table A.
I cannot preview the data.
I want to send email only if the record_count>1

record_count is undefined. Perhaps you meant: parseInt, decodeURIComponent, parseFloat, encodeURIComponent

Resolution:
Please check the spelling of the variable

Do you mind showing me how you have the SQL Server - Execute snap configured? The way you wrote your SQL the column name is record count (with a space), but in your expression you use record_count (with an underscore). Maybe there is some difference there.

Fields are case-sensitive, so try the expression in your Router without a capital ‘R’ for $Record_count. Also, I believe the return type of count is int, so you shouldn’t need quotes around the zero either.

$record_count == 0

I did match the case but got below error
Router expression $record_count==0 did not evaluate to a boolean value. Instead got type: String

Resolution:

Please address the reported issue.

The = next to the expression will toggle it on and off. When it’s light gray that means it will treat the value as a String. Can you toggle it back on and try that?

18%20PM

it gives same error for both options

Try playing around with this example to see if it helps you figure out the problem.

router-example_2019_08_29.slp (3.9 KB)

Thanks tilkarish for helping.

I was able to get it by using select instead of execute snap.
I want to know if the query in in sql execute how can we get the column recognized in router.