Stop Data.ImportCSV from running


There probably is a fairly easy solution to this…
I am using data shapes to allow users to pick a CSV file that has a list of parameters saved. (to choose a specific PDF file name).

If the user does not want to import a csv file but rather pick another option for PDF names i dont want Dynamo to import a csv file. (Also because not everyone has a csv file on their computer when first running this script.)

Is there a way to stop this error message/ stop the node from working when i dont want it to?
Maybe just code in a codeblock?

A function.apply node would suppress the warning.

Hi Jacob, thank you!

Unfortunately, the dynamo dictonary doesnt show pictures for me…

Could you tell me where to put the node/what to connecet to it?

  1. Place the Data.ImportCSV node on canvas and put no input into it. Notice the node has a light grey color - this means it is in a function state. If you run the graph as it is you will see the output is a Function.

  2. Place a Function.Apply node on the canvas. Wire the function from the Data.ImportCSV into the Function input. This will be what the data given to the node will be run through - and since you gave it the Import CSV node, you’ll be attempting to import the CSV.

  3. Wire the desired path or the non-pathdirectly into the arg1 input on the function apply node, and runs the graph.

1 Like

Thats fantastic, thank you for your help!
Worked like a charm :slight_smile:

1 Like