If the variable value changes from the selections you make or action resulting from the click of a button or text object, you may save the status as a bookmark and reload the bookmark when you reopen the application.
By an input field, this is the easiest way tha t i know to change a variable value. I've done it in the desktop version and it works fine, cause when the user reload data pushing a button data transformation uses new values.
I 've tried but I don't know how to save values into the document. When I reload data variable values returns to their previous value.
There is no activity in the Access Point or any of the clients that will affect the QVW file hosted on the server. QlikView server will remember some of the stuff you create on top of the QlikView document (like bookmarks and other server objects), but they will be stored in a separate repository file and will be merged in RAM with your document when you re-open it in the AccessPoint.
Therefore, there is no immediate way to influence a QDS reload like you can in the QV Desktop as the Distribution Service will only take the QVW document and task settings in account. Alternatives:
Define Document Administrators that manage the corresponding tasks in the QMC. In Publisher, tasks can set variable values outside of the actual QVW document
Add a shared input file from which the document at the next reload will read additional configuration settings.
Yes, that way you may pass a variable with any number of values to the task-to-be-triggered and subsequently to the QVW that is going to be reloaded. Just like a variable you define in the task configuration.
Remember that the variable should exist before you can set it. And you should only set it in the script if it doesn't exist yet. Otherwise the passed value will always be overwritten by the script statements.