Skip to main content
October 23, 2024
Question

How does {} really works ?

  • October 23, 2024
  • 7 replies
  • 0 views

Hello Appian Community,

I'm trying to figure out why both of these codes don't react the same way ? Any guess ?

7 replies

stefanhelzle0001
Brainy
October 23, 2024

In the second screenshot, we can see the actual value of that local variable. What is the value on the first screenshot?

October 23, 2024

SelectedMetier use a simple saveInto and get the same value (2) and is reseted to {} when I use the if() synthaxe which dosen't happen when I simply use the second code :

 

sarathkumr268295
October 24, 2024

Can you post the value of the local variable when you are trying to execute the code in first screenshot

somasundaram.d
October 24, 2024

During initial load both the codes will initialise loca!selectedMetier to empty list of variants, that is {}. 

Can you please elaborate your query

October 24, 2024

The fact is, that only the if() version reset my value (2), when I check a checkbox, I'll try to sum up my case :

Oh... the exact same code that didn't worked yesturday (The if()'s one) is now working and don't reset my value... I don't understand, I'm sorry i'll investigate and if I have any explanation i'll let you know... 

November 8, 2024

Thank you so much for the help.

stefanhelzle0001
Brainy
November 8, 2024

Using lists in the condition of an if(), combined with lists for the true and false values can be very tricky. I highly suggest to not do that.