What I do is:
Every time a variable (including Booleans) is changed, I call a "save" function.
This function writes ALL the variables I want to save to local storage (not just the one that just changed) to a dictionary ("Add key" action)
For example, if I have a Boolean named "mute":
Key = "mute"
Value = mute
This stores either a 0 or 1 in the dictionary against a label of "mute" (I use the same names for labels in the dictionary as the variable I'm storing there).
After I've saved all the variables to the dictionary, I then save the dictionary to local storage.
So, my dictionary is called "saved", so on the LocalStorage object, I use the Set Item action with:
Key = "saveData"
Value = "saved.AsJSON"
So now there's a single key in local storage named "saveData" with a value of the JSON of my dictionary that contains ALL the values.
To load them:
On start of layout - LocalStorage - Check item "saveData" exists
Then:
LocalStorage - on item "saveData" exists:
On the "saved" dictionary object, use "JSON - Load" with:
JSON = LocalStorage.ItemValue
Now the whole dictionary has been loaded back from local storage
Then I can read through the dictionary for all the values loaded back into it and set the corresponding variables. For the "mute" Boolean above, the event would be Compare Values on the "saved" dictionary object where:
Key = "mute"
Comparison = "= Equal to"
Value = 0
And the action would be to set the mute variable to "False"
Then add an Else that sets that variable to "True"
For an integer or string variable, I just set the variable to the value of the corresponding key in the dictionary.
Hope that make sense!