Hello all,
Is there a function or process within Appian to store and specific value for every user? (Similar to session variables in.Net,)
the use case is: We have a dropdown with general values in our main page, so depend on the value selected all the subsequent pages needs to take care of that value. We want to store that value selected for every user in his own session.
I did some research to use constant, but for this we need to create constant in sail code (in appian it's no possible, only update), it's not a good approach. Another thing that we discuss was to pass the value as a rule input in every object (interfaces, query rules, Process Models, etc) not sure if its a good approach since the user can go directly to other pages (saved as bookmark) even if no value is selected, but it's a must for our app.
Another approach that we are thinking it's storing the value in a "customfield 1" but the function doesn't work "a!updateUserProfile()".
Thanks in advance.
Discussion posts and replies are publicly visible
a!localVariables( local!choices: { "choice1", "choice2", "choice3" }, local!customField1: user(loggedInUser(), "customField1"), { a!dropdownField( label: "Select option", choiceValues: local!choices, choiceLabels: local!choices, value: local!customField1, placeholder: "-- select --", saveInto: { a!save(local!customField1, save!value), a!updateUserProfile( user: loggedInUser(), overwriteAllFields: false, email: user(loggedInUser(), "email"), firstName: user(loggedInUser(), "firstName"), lastName: user(loggedInUser(), "lastName"), customField1: local!customField1 ) } ) } )
Hi,
The a!updateUserProfle() in above code is working for me, I think we need to pass firstName, lastName and email since those are required fields even if overwriteAllFields is false
Thanks for your answer ,
but this doesn't work for me:
probably it's because the version, I don't know. we are runnignn 22.2
Can you share how you are using it, because you cannot assign value (line 9 ) the way you shared in the screenshot, you can only fetch it and it should be executed inside a saveInto. I am also using 22.3.
Hi! ,
I was executing this in a standalone expression, I was not aware about the needed of use it in a save into,
I move directly to the interface in the save into and it works,
Thanks a lot!