Hello,
I’m building an inventory checkin app and would like to store an array or upc codes and descriptions in localstorage so the app can show description once the barcode is scanned and not have to run an sql for every scan.
I am able to pull and store the data in localstorage but having difficulty searching and populating the description field using localstorage.find. There’s isn’t any article available that shows how to use localstorage arrays.
Any guidance would be appreciated.
Hi @Rkhan,
It sounds like the hardest part of this feature for your app is already working!
I highly recommend you to check this couple of resources to get comfortable with localStorage:
.find is an array method and will not work on the localStorage object. Furthermore, the values in localStorage must be strings. However, you can use JSON.stringify & JSON.parse to do some data manipulation and organize our localStorage object for easier management.
Hi @Rkhan! I apologize for the confusion. Within Retool, we only have access to Retool's localStorage API, which abstracts most of the data parsing and gives as access to .values and .setValue()