cancel
Showing results for 
Search instead for 
Did you mean: 

Having issue with .contains

TAM
New Contributor

Here is what I have $message.contains(‘successful’) ? 1 : 0 . This should give me a count of “1” if the Stored Procedure executing correctly. I then have a UNION, AGGREGATE and a ROUTER to count the SQL EXEC snaps, however it is only counting the first one and not the rest. At the end I have an email if $cnt == 10 then Success email, if $cnt < 10 then Failure email. Since the counts are not happening the emails are not generating. Any help is appreciated.

14 REPLIES 14

aleung
Contributor III

Please share your pipeline so it is easier to understand where the issue is.

TAM
New Contributor

image

Here is what I have, In the mapper(s) I have:

image
The Union then

The aggregate:

image

The router:

image

The email section:

image

aleung
Contributor III

what I would suggest is the capture the documents right before feeding to Aggregate snap, that should give you an idea what might be wrong. Please share the json doc (from Union output view) if you need more assistane.

You can either do validate to obtain it, in case there is any issues. You can do JSON formatter and File Writer to capture for debugging purposes.

TAM
New Contributor

The thing is I had it working where the .contains it was doing the count of “1”. Then the Aggregate snap would do the counts 1,1,1… Then the router would have the cnt == 10 it would send the Success Email, if the cnt < 10 It would send the Failure email. Right now from the SQL Execute Snap I am not getting a count when it runs. I was before and now I am not.