Avoid generating errors when list empty i.e. stop script

I have created a script that enables batch creation of FamilyTypes (wall, floor, roof) by reading the parameter data from an excel workbook. The data is read from multiple sheets.

The problem is when one or more sheets are empty (for example when there is no need to batch create roof FamilyTypes) the scripts naturally generates an error because a lot of nodes are fed with empty lists.

This script will be used by multiple persons in the company with the Dynamo Player and I would like to avoid generating errors so as not to confuse the users.

Is there a way to stop a branch of a script if there is no data in the sheet? Or can I somehow allow the user in the Dynamo Player to limit the scope of the sheets that will be imported?

Clear List node by Archi_Lab

I am not really sure how this node is supposed to help.

I am looking for a way to stop or freeze one branch of a script from working if it is fed with an empty list. So as to not generate errors if there actually isnt any data to imput.

have you seen this:

Sorry! That was meant to be in another thread! No idea how it ended up here. :expressionless:

Yes I did some research before posting the question… The Scopeif node requires two independent inputs and I’m not sure if I can produce two independent inputs while reading the data from an excel file