Skip to main content
Participating Frequently
Oct 23, 2024 1:25 PM UTC
Question

How does {} really works ?

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
Oct 23, 2024 2:49 PM UTC

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

Participating Frequently
Oct 23, 2024 2:55 PM UTC

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
Known Participant
Oct 24, 2024 5:54 AM UTC

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

somasundaram.d
Employee
Oct 24, 2024 8:52 AM UTC

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

Can you please elaborate your query

Participating Frequently
Oct 24, 2024 1:50 PM UTC

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... 

New Participant
Nov 8, 2024 10:40 AM UTC

Thank you so much for the help.

stefanhelzle0001
Brainy
Nov 8, 2024 11:15 AM UTC

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.