X doesn't equal y

Hi guys, I’m trying to create a list logic that would return me the value of index 0 (in my case H1) if the subsequent indexes value is not 0 (outcome of B is what I’d like to achieve).

I’m able to retrieve data from my schedule by using GetScheduleDataColumns node by BIMorph Node. However, when passing thru the logic, it failed (A).

Why does the logic work with code block (B) but not the data I retrieved (A)? and how I can fix it?

Many thanks!

Hmm looks weird.

Could you check if the Types of the list you are evaluating (See blue square) are Numbers (Integers and Doubles)

The only explaination I can think of is that that list is not return Numbers, but plain Text (Strings). If you check if the Integer 0 == string “0”, you will get a false result.

Also, can you unfold all the results underneath the nodes so we can follow the flow of the graph more accuratly? I am curious what result you are getting at the green rectangle. (Probably all true)

I’m not sure what’s thz intended goal here but retrieving schedule data is usually not a good way for me.
If it’s in the schedule then it’s data Dynamo can access, I’d work directly with the data not the organized/filter data from the schedule.

Hi Joel,

Thanks for the tips, it worked!
I connected a to number node and it worked as how I wanted it. Thank you.

You can also make the 0 in the codeblock a string by doing “0”. this will not return an error like the String.ToNumber Node.

I think the error is because I have H1(not a number) in the list, so it can’t be converted to a number.

Yes and by using a “0” instead of that node, you will not get any errors in your graph

Hmm… I’m not sure if I understand you correctly? But using “0” in my code block still shows an error for me :sweat_smile:

Like this.

Sorry I am just a big fan of error free programming and this is something you can easily program around :sweat_smile:

Owhh yeahh thanks Joel! Seeing the yellow warning is really an eye sore. I got it done. Thank you so much