Local Storage is showing null on first load

Domhn-please help i keep getting null,whenever i try to login to my app-I used the Local storage component to save details for next login
And the stored variable not working.
I want users to have their details saved for next tine login into the app

Hi @itzvinie, is this a question about the sign in component?

Yes it is

Ok, got it.

So just a couple of things for future reference - if you’re asking a new question, that’s not related to the original topic, then please create a new topic for it.

Also, mentioning individual users in your first post is considered bad etiquette in the community. This is a community not chat support. It should be open to anyone to reply and help out rather than singling out individual members.

FInally, it seems like you have a very similar post already - please use existing topics rather than posting elsewhere about the same issue.

Thanks!

My bad,am so sorry for that

Really Sorry

same… mine concept is easy, in my app have a features checking points balance so in many merchant wallet, as first install, or users of course their balance is 0, but instead zero, null object… and this blocks don’t work
saa

Null in math functions converts to 0.

x <- absolute <- null

1 Like

ops… i appreciate your help, but a visual guide of blocks of more text info can help me solve it

Your code does not work for the reason that Local Storage returns a value that is not null. But what does it return? The string is “null”.

can u please show me correct blocks? that show in a label if i call local storage that is not yet store anything for the first time.

изображение

There’s also a null block that you could use instead of the “nul” string @actech?

thats not working sir. Please do see my blocks at the top

@domhnallohanlon, the value parameter from the Local Storage Get block has a string type, and not a special null value, as many users think.

1 Like

this one is correct, it solve my problem to null issue @actech but returning to NaN when i saving a value to local storage

The NaN value appears when the result of the mathematical operation is not a number, for example, you are trying to add a string to a string.

1 Like

I agree @actech because got the error, what im trying to to is add a text to a value that may contain quotation marks (" ") like the value looks like “23”, and easy blocks to solve this, this is the only thing i need and finish my projects

1 Like

Hi @DevilLooper,

This app might be helpful to you. It will take some text input and remove all characters that are not digits from 0-9, returning an integer.

For example, ‘thunkable1’ will be converted to ‘1’, ‘1thunkable2’ will be converted to ‘12’.
To prove that this resulting integer can be parsed by the math blocks, the app will display 1) the number once other characters have been cleared and 2) the result of adding 1 to this number using math blocks.

If you want to facilitate decimal numbers, you can add a period character ‘.’ to the listOfDigits in the app. This tutorial has advice on making sure that there is only one decimal point in your number (a number like 1.2.3 also cannot be parsed by the math blocks).

Jane

1 Like