Retrieve max value from a retool table and put it in localStorage

I normally use the code below to get a value from a retool table and put it into localStorage

localStorage.setValue ("minvnumber", table4.selectedRow.invnbr);

Now what if I wanted to get the maximum value of "invnbr" instead of the selected Row. What would be the code for that?


// Variables to hold max value
let maxValue = 0;

//converting the object to an array
const values =;

//Using the .map() method to loop the array, find maximum value => {

//getting the value from each object and comparing to existing value
const valueFromObject = el.invnbr;
maxValue = Math.max(maxValue, valueFromObject);

//Printing out the result


It worked perfectly! Thank you so much!

You have introduced me to an aspect of the language that I have not seen before.

This has gotten me over a big hurdle.

Thank you again. I have marked this as a solution.



I wanted to ask you one more question about the language you are using.

I take it that this is JASON.

I plan to study this language. Can I use this language in Retool? Currently I have been using to
tools written in JASON without really understanding the language.


Hi Mike
That is Javascript. You can use it in many places in Retool. Very handy to learn.
JSON is not a language - it's a way to format and store data.


Thank you very much.

I see that W3Schools has lessons on JavaScript.

Thanks again.


I am having serious problems with transferring data from my tables back to the server with:

Is there some way of transferring data back to the server with JavaScript?