If statement makes script run twice

When I don’t set parameter name, it looks everything works as expected. but when i I connect the node, thats when problem happens. I suspect it repeating itself because when I place a transaction end node it runs twice - it has two “undo” dynamo script in revit.

I only need sheet number to show once in value like the first pic
Would like to know what I am doing wrong.

Found the reason.
Its when I DS these If statements that causes issue:

if the code block has no error (even if not connected to my graph) it will cause error.
I think this is bug because it causes script to run twice. My previous post alluded to this issue to on another graph. Or maybe someone knows how to codeblock these statements properly.

Any suggestions on how to use nodes when there is more than 2 variables get GetItemAtIndec
ie code block above is:

I think it can be DS codeblock except for the If node.

Hi @AB01,

I think that’s what you’re looking for.

The ‘if statement’ sounds more like it’s due to an element Updater than a bug. Wire the node in, don’t run the graph, save it, open it, and then run it and see if you get doubled results.

Still doubled results.
Funny thing is i get double results at first run, single result at second run.

Durmus, i get kw_class error. is it more than it seems to the code block?

Hi @AB01,

Can you upload your entire chart. Seeing what’s going on is a quicker solution.

1 Like

Double result still happens.
It will happen on very first run. after that it works normal. but once re-open, double result happens on first run again.

I think problem occurs because of if test code block, but not sure how to make that code block into nodes because it has more than two possible outputs, but if node only has two? unless i create chain of if nodes?

node below:

search views.dyn (20.7 KB)