Hello, I’m running into an error message from the Loop End node when using the Empty Table Switch and I was wondering if anyone had advice on how to fix it.
I originally had a workflow like the screenshot below. It worked as expected - each file was read in, converted to JSON, the JSON fields were selected and some basic data munging was done, and then it output two separate .csv files.
If the field has that value, the row should be skipped and the next file should be read instead.
Running this version of the workflow breaks at the Loop End node with the message “Active Scope End node in inactive branch not allowed.”
I’m not sure what this error is trying to indicate and have tried several alternate approaches but haven’t found any way to do what I need to. Does anyone have a suggestion on a different approach to take, or a way to fix this one?
The specific error is because your Empty Table Switch has to be completed (with an End If or Case Switch End node) before the Loop End, because otherwise, in the event of the table being empty, the branch that is attached to the Loop End becomes “inactive” and that isn’t allowed.
In your case, you have two branches to be undertaken on a non-empty-table but you have specified nothing for the empty condition. To wire that up with valid branch terminations, you could do this:
In the event that the table is empty, do the columns specified by Column Renamer and Column Resorter not exist? If so, I can see why you need to branch, but if the columns are always present, does it work anyway without the presence of the Empty Table Switch?
An Empty Table should not in itself prevent the loop continuing, and should have no effect on the output from the loop, since an empty table does not add any rows to the output. It is (in effect) “skipped”, which is why I wonder if you need the Empty Table Switch at all…
What happens if you simply leave in the Row Filter but remove the Empty Table Switch? Does the loop not complete?