got it! thanks but I did something slightly different instead. I had to create a storage variable via the model and storage window then only map.
Is there a way I can do it via javascript instead of using the model and storage option like you mentioned?