Code block with If statement problem

Please help, i don’t know what is the problem in this code block
I need to say, if(a=true,b,c)
where (a) is a list of sub-lists bool tests, and (b) is a single item string , and (c) is a single item of an empty string as shown in the screenshot .
I think that the problem is that the if code block is taking the first result of the bool test (which is false) and apply it to all the list, it doesn’t use each item’s bool test, it uses only the 1st one.
Maybe it is a list levels problem, i don’t know.
Thanks in advance for your help

Hello,
There are very very often many examples don’t forget to consult the search before opening a new topic

//  Test    (if) (action if true)   (else)  (action(s) if false)
result==""   ?         ""              :        "'"  +   result;

Cordially
christian.stan

1 Like

I did a lot of effort before i post this, and i don’t understand your solution, please keep in mind that not all people understand what you may understand, i tried to copy your code block but i couldn’t find where to connect the test, and the result value if true, and if false.
Moreover i tried to understand the logic of your code block, but i couldn’t
I am not an expert like you, please explain and come down to my level because i can’t go high for yours

@faramawy ,

check out here :slight_smile: … i pretend to be an expert :wink:

i like this solution very much! it is a perfect “punch” to solve conditions!

KR

Andreas

2 Likes

I’m not an expert, I tried to do my best for the explanations
you can hook the Obj to string node to the codeblock for the first example (you can change the apostrophe to comma by the way)

(here is another example with searched numbers divisible by 5)

(num%5)>0?"No":
"Number divisible by 5";

Cordially
christian.stan

1 Like

Actually, I tried to understand this node, and finally i got what i want, but it is still very difficult to me to understand, but it is working by test.
Also i had to swap between true and false to get what i want, i mean it should give me an inverted result as per my understanding.
anyway, many thanks to you and your time all, i will thankfully accept this as a solution.

2 Likes

many thanks to you, for sure i’ll visit the link and try to learn…

2 Likes

Here is with your starting test
(hoping to clarify: the test is a boolean result)

Cordially
christian.stan

1 Like

Yes, this is way much better, many thanks again and again

1 Like

You’re welcome :wink:, it’s by asking questions that we progress (I still have a lot of personal questions to clarify)
cordially
christian.stan

3 Likes