Run node if it was ok before

Hi,

I used WAIT node to delete a csv file after reading and loading on database, but, i d’ont knew how to delet only if the loading on database was ok

now : i juste wait 5 seconde to delete file , is their another node or option to run the next only if the last was ok ?

Thanks

Hi @nadiroun,

you could try to connect the DB note with the note where you delete the file via FlowVariable connection. This way, the second node will only run after the first node executed fine. However, this depends on the first node to fail if an error occurs.
Another option you could try is to use the If Switch node. This node has one input and two outputs and will forward the input to the output depending on a flow variable boolean (see node description of the If Switch node). The other output will be deactivated, meaning that all consecutive nodes will not run.

I hope that helps.

Cheers
David

2 Likes

Hi ,

Thanks @DaveK

i use if switch !!

  1. i read the file

  2. i load it on database

  3. i count number of line ( count_line 0 then TOP or >0 then BOTTOM) and i use a flow variable (table column to var)

  4. the default value of the node If Switch is the flow var count_line

  5. it works

Thanks

1 Like

Hi @nadiroun,

glad to hear that. Could you maybe mark my answer as solution? Then it will show up as solved in the forum overview.

Thanks

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.