Hello Appian Community,
I am trying to set a value = to something else like a simple java statement x=fo but I keep getting false,
why is the default value for =, in appian == in java?
sorry for the noob question but, I have spent hours searching for an answer but have not been able to find anything.
I am attempting to set a value in a interface when one field is changed then another will be reset.
I assume this is possible, however I have not been able to find an example,
thanks,
Kevin
Discussion posts and replies are publicly visible
In Appian, local variables are set using colons, : . You can update the values using a!save() in certain components https://docs.appian.com/suite/help/20.1/enabling_user_interaction.html
For example
a!localVariables( local!message: "Hello World", { a!textField( label: "Message", value: local!message, saveInto: local!message ) } )
thanks for the reply,
I am trying to link two dropdown fields so that when I change one the other resets
what I have currently is:
saveInto: { if(isNull(ri!var2), ri!var1 ri!var2:null
}
my logic if var2 is empty
save var 1
if not
clear var 2
figuring the user could just redo the value they put in and It would not crash like it currently does
What Danny described above is how you initialize a variable. However, in the use case you described, it looks like you want to save a value into a variable. The easiest way to do this is to use the a!save() function to define a target variable and the value you would like to save to the variable. I'd suggest trying something like this:
saveInto: { ri!var1, /* I'm assuming you always want to save the value of the first variable */ /* or else your dropdown wouldn't remember the value chosen by the user :) */ a!save( target: ri!var2, value: null ) /* You shouldn't need any logic like an if() or isnull() here because you */ /* would always want to save a null value for var2 when you update var1 */ }
If this still doesn't work, I'd also recommend looking at the recipe for a cascading dropdown since that seems pretty similar to what you are trying to do!
thank you so much Peter!
works perfectly