IF Then Write To Excel


Hi guys, I’m trying to write a graph that does some stuff but has a boolean to control whether or not it should write data to excel, but for the life of me I can’t figure out how to make this kind of IF statement work. You can see in the attached screenshot, but it seems that it will always write to the excel file. I suspect this is because there is input feeding into that block of nodes, but that’s also necessary for writing data.

Any ideas?


I think you may be looking for this kind of logic:


I used something similar to what @Andreas_Dieckmann suggest, just written in a code block, but that was before “freeze” was added… isnt it that you are looking for?

right click on a node and select “freeze” then it will not run that node.


@Andreas_Dieckmann thanks for this! This exactly the functionality I was looking for. If you don’t mind could you explain why you must use a Scopeif statement? I tried “If” and it didn’t work but scopeif seems to. That being said I can’t find much documentation on the difference between the two.

@erfajo No, freezing is not what I’m looking for as this graph is intended to run from Dynamo player, as such it has a popup window asking the user if they want to write the data to a file. So I need to trigger whether or not that section of the graph runs based on a boolean, not manual freezing.


maybe you are then interested in datashape by @Mostafa_El_Ayoubi


Haha, shout outs to @Mostafa_El_Ayoubi, that’s already what I’m using :stuck_out_tongue: