Hi everyone. Could someone help me with changing all the values in a dictionary? Basically, when a user clicks a a!dynamicLink we want all the values in a dictionary to go from TRUE to FALSE. I've tried using a loop with no success.
Any suggestions are appreciated.
Discussion posts and replies are publicly visible
You can try something similar to below:
a!localVariables( local!items: {a!map(isActive: true), a!map(isActive: false()), a!map(isActive: true)}, a!linkField( links: a!dynamicLink( label: "RESET", saveInto: { a!save( local!items.isActive, repeat( length(local!items), false()) ) } ) ) )
What version of Appian are you running? There is the a!update() function that allows you to update individual attributes. Here's an example:
a!localVariables( local!data: { { id: 1, name: "A", isActive: true }, { id: 2, name: "B", isActive: true } }, a!forEach( items: local!data, expression: a!update(fv!item, "isActive", false) ) )
...and the result is:
[id:1,name:A,isActive:false]; [id:2,name:B,isActive:false]
We are using the latest version. Thanks!
Worked just the way we needed it. Thank you!