I am familiar with saving Tables to Retool then taking values from the Table and putting them in localStorage.
But I need to find a way of transferring values to localStorage without restoring a data file to a Retool Table.
I am trying to use the Success Handler "Set Local Storage" as per the screens below:
This screen shows where I derive the value @GrTotal . It recognizes the value as 5374.52
The Value is 5374.52
This screen shows the syntax I am using for the Success Form Set Local Storage
This shows the properties of SaveTaxes01.
It is registering the value
@GrTotal of 5374.52
Yet nothing is transferring to Local Storage. I suspect that I have a syntax problem in the Success Form.
If anyone has suggestions, I would be pleased to hear from you.
Mike
local storage is key/value paired, it looks like you're missing the key part
Bob:
What goes into the "Key" field?
Mike
whatever you want to name that value. its the same as a variable name
Scott:
I don't think the variable is transferring to the Local Storage form.
See below:
Here is where the variable @GRTOTAL is generated. It has a value of 1761.7
Here is the reference in the Success Handler to the local storage form.
If I click on the calculating field, it says "undefined"
If I check the local storage, again it says "Undefined".
I don't think the value is transferring from the initial screen to the Success Form.
Any thoughts?
Mike
Paulo
June 17, 2024, 6:47pm
6
We have to do something similar to what we did here:
From looking at this:
[image]
There is only one value for the key, and it is [0]. In other words, @i:=0 = [0] where @i:=0 is the key, and [0] is the value. We cannot access the index of 2 because there is only one element in the array, that is why you are getting undefined again.
This is because the query is running a SELECT @i=0, this is returning the value of @i when it is assigned (0).
Let's take a step back.
The query that you are running sets the value of the "f12" column in the "lette…
They key in SaveTaxes01.data
is not ["@GRTOTAL"]
but ["@GRTOTAL :=NEXTRA1"]
. The space character can be an issue. I would remove the space in the SQL query, setting the variable to @GRTOTAL:=NEXTRA1
(instead of @GRTOTAL :=NEXTRA1
).
After that update, set the "Value" of the Success event handler to:
{{SaveTaxes01.data["@GRTOTAL:=NEXTRA1"]}}
1 Like
Paulo:
It worked!
I think I have enough samples now that I can get this to work in the real world.
I will mark it as a solution.
Thank you so much.
Mike
1 Like