Hello Bart, I tried the "Detect empty stream" transform, but unfortunately it didn't make the job: it generates a null row with no input, but it also generates no rows with a populated input... so I can't properly intercept the invalid inputs.
I solved it by using a "Group by" transform instead: after filtering the rows I count how many rows were discarded by the filter (i.e. went through the "false" hop). With the "Always give back a row" unselected and no fields specified in the "Group fields table", I got no rows if there are no errors, and a single row if there were any errors: then I can add a constant and use it to set the variable. Thanks anyway for your support DC Il giorno lun 16 set 2024 alle ore 14:43 Bart Maertens <[email protected]> ha scritto: > You could add a "Detect empty stream" between your filter and your "Set > variables" transform. > In that case, you'll have one empty row if all data was processed without > errors (which I assume is what you want to do) and your Set Variables > transform should work as expected. > > Regards, > Bart > > On Mon, Sep 16, 2024 at 2:15 PM Davide Cisco <[email protected]> > wrote: > >> Hello, >> >> is there a way to set a variable when a row passes through a determined >> transform? I tried to put a "Set variables" transform after a "Filter >> rows", but the variable is set to its default value even if there are no >> rows selected/discarded by the filter. >> >> The detailed scenario: I have a workflow, and included pipelines, that >> process database rows and have to check if those data satisfy some >> constraints. A variable - that rules whether the log is sent by email or >> not - is included among the project configuration files and set initially >> to "false", so that the email is not sent if there are no data errors in >> the workflow. That variable should be set to "true" (and never reverted to >> "false" by other checks!) in case a row violates any of the conditions, so >> that the email could be sent. >> >> Thanks for your help, >> >> DC >> >
