Number stored in Text field gets stored with comma

I am developing custom Mobile OTP based login screen and I am trying to store a number (Example - 4603) in Password field in Users Collection.

But It gets stored as 4,603 with a comma instead of 4603.

How do i overcome this?

@anon78309838 - Can you pls get some help here?

Hi @Kaigal. Is there a specific reason you are storing it as a text property instead of a number?

We are trying to build custom Mobile OTP based login.

For that, we are using 4 digit number as a password. This gets stored in User collection in password property so that i can make use of LogIn/User Sign up predefined actions.

This is the use case.

I cannot reproduce this at all. Everytime I use a text input, either as a password, number or normal field type and get it to update the user property it saves it without any commas.

Can you tell me the name of your app that has these records stored with a comma please.

As with @anon78309838, I can’t repro this either.
When you say this ‘gets stored as 4,903 in the database’ , are you seeing this value stored when viewing in the actual database viewer, or in a field which shows the database value ?
If it’s the latter then it could just be the Number Format’ value on the field being set to 'Default, as opposed to ‘None’

@anon78309838 @Jay - App name is KaigalJobsAppFinal

We have a collection where we generate a 4 digit number and store it as Number property.

This value is then copied into Password property of User collection. This is where the problem occurs.

When I perform user login from the app, If I enter 4903, it throws back “Login Failed error”. If I enter 4,903, then It goes through.

Moreover, since this is the password property, I assume, we cannot directly view it right? I tried updating with 4903 and tried user login, it is working.

Why not just directly update the password property in the user collection then? What do you mean by “copy” it to the password field?

@anon78309838

We generate a One Time Password using RAND function (4 digit random number) and we send that to the user’s mobile.

Same One Time Password is copied to password field in Users collection so that next time, the user can be authenticated using the pre-defined user login action.

How are you copying this OTP number (where is this RAND function? I cannot find it)? I don’t see any function for that in your app. I do see a custom action though that is running as a screen action (which currently won’t provide you a return value).

Its there in Signup screen as an auto field.

Right, got you! Ok I am now able to reproduce the bug and I have submitted it to our team.

@anon78309838 Thanks !!

For now, I have an update users collection action after signup to update the password field with Number format value set to None. This format option is visible only here, not during the first time of copying the OTP to password property

@Jay Thanks. I found a workaround for now based on your tip, to overcome this issue

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.