localStorage.getItem is not a function

Hello !

I have a javascript command that is supposed to execute a REST API call in javascript to generate an access token, then save it into a localstorage variable, and reuse this access token variable in another REST API call.

However, right now the localstorage is not getting any value, while my call to this variable is just showing "localstorage.getiteam is not a function".

The call to the variable is done like this:

image

Regards,
Cy

Hi @Cy_To

Thanks for reaching out! .getItem is not supported. You can set localStorage by using our GUI in event handlers or by using Javascript and .setValue.

After that, you can reference the saved value by returning localStorage.values[key-name-here]

Here's an example:

1) Set the value from your API query:

2) Since I've stored the value in localStorage under accessToken, I can now reference it with: localStorage.values.accessToken in a query:

Hope this helps!