I am trying to save to localStorage from the selected row of a table and this is not working.
This is code that used to work and I am wondering if there are some changes that I have missed.
I am including a screen capture. Nothing goes to localStorage.
Mike
OOSC3
February 16, 2024, 8:03pm
2
Hello!, try changing table4.selectedRow.data.invnbr
to table4.selectedRow.invnbr
Yes, it worked perfectly!
I have been using the previous format in my code in several places, so I hope it continues to work.
Anyway, you have really helped me. Thank you so much.
Mike
1 Like
I wonder if I could ask one more question.
Is it possible to extract values directly from a MySQL Table (versus a Retool Table) and put that into localStorage ?
Mike
yes sir, i believe you can. you just need to setup the connection as a resource for your org, then you can select it as a query source in any of your apps: Connect to MySQL | Retool Docs
hopefully you dont get annoyed w me saying it, but if you need more help always feel free to reply or send a dm if you prefer.
Thank you Bob:
I already have invnbr2 connected as a Resource.
I have the code below that gets the max value of invnbr which is one of the columns of invnbr2.
select max(invnbr) from invnbr2
The name of the variable in localStorage is "minvnumber".
How would I get that value into localStorage?
I have tried:
localStorage.setValue ("minvnumber", select max(invnbr) from invnbr2.invnbr);
but this doesn't work.
Mike