Invalid Cognito Phone Number - amazon-web-services

We have been trying to upload users to cognito via the import jobs. However, seems like the phone_number attribute refuses to accept Indian mobile numbers. The format for phone number is like +919839999999. The phone_number_verified field is set to TRUE. Below is the error I receive:
[FAILED] Line Number 21 - The User Record contains an invalid phone number for the phone_number attribute.
From the documentation, cognito does say that after first two characters of country code, it looks for area code but I am not sure if that'll be the case when using cellphone numbers.

It seems if you are using google sheets, you have to re-convert the format to text of the cellphone fields or manually edit the csv. It works then

Related

How to simplify phone_number field update Process in django including verification

Problem Description:
We have a User model where Phone number is been set as username and its unique=True,
We also have a field where to represent verified/unverified users. And we verify users by OTP verification to phone number. So now we need to add a new feature where user can replace his phone_number and then he will go to verification process and then we will change his number.
And also We need to preserve his previous number (which he already verified) until this new number is verified.
If for some reason user decides to go back without verification we delete newly added number and keeps his old number as username.
So what would be the best way to approach this problem
What I'm considering to have another Model linked with ForeignKey to User
class AlternativeNumber(models.Model):
user = User() # forignkey
number = Charfield
is_verfied = BooleanField
So we will be verifying users number and replacing his original number from his alternativenumber_set
Do you think we can simply it more. Do you think it might have some flaws or we go with a better appraoch ? thanks.
In my opinion you can add two new fields to the User class
alternative_number = CharField
is_aletrnative_verfied = BooleanField
which is really similar to your approach, but it is simpler because all the data is in one table. if a user did not verify his number then you can create a cron job that checks if the is_aletrnative_verfied and if it was false then delete whatever value is in the alternative_number just for the data to be consistent.
Hope you find this helpful!

How to make a Bangladeshi phone number field in the model of django?

Is there any package or widgets to do so?
Example numbers:
[+880][17][59219191], [+880][16][59219090]
Here [+880] is country code, which is constant,
[14],[16],[17]...etc are service provider numbers
[59219090],[59219191]...etc are third part of mobile numbers in Bangladesh.
You can use django-phonenumber-field and set PHONENUMBER_DEFAULT_REGION for your national.
you can use phone number field as CharField then use widget in ModelForm fields. Take help from this to apply masking of filed link

Validate Email Or Number in Regex

I have a sign in form where userid is email id of users or unique id given by us i.e in integer.
So i want regex for that text box to validate email or Id.
Means.
if someone enters
abc#abc.com
or
1024
then it is valid
and if someone is entering anything other than email or integer than it should show as invalid.
Thanks...
^(?:[\w.]+#[\w.]+|\d+)$
You can try this.Though Your requirements are not very clear.See demo.
http://regex101.com/r/zU7dA5/4

Regex Input Validation Limit to maximum no. of commas

I am running jQuery Autocomplete with a Laravel form field.
It grabs data from my db
Specialty Area Examples: Real Estate, Mortgage Lenders, Renovation, Buyer's Agent, Listing Agent, Relocation, Short-Sale, Consulting, Local Experts, Refinancing, Architecture, Home Building, Carpentry, Electrical, Engineering, Interior Design, Landscaping, Painting, Plumbing, Appraisal, Commercial Property, Insurance, Legal, Conveyancing,
Users can type in one of the examples and the autocomplete will complete the rest in the field.
I want to limit the user to being allowed to input a maximum of 4 Specialty Area Examples into the form field. So a user can type in for example:
Real Estate, Short-Sale, Consulting, Local Experts
After that the user should not be allowed to input more data. So the maximum number of commas I need to set in the form field is 3.
Try this:
$("#txtBox").keypress(function (e) {
var input = $(this).val() + String.fromCharCode(e.which);
if (input.split(',').length > 4) {
e.preventDefault();
}
});
Demo: http://jsfiddle.net/y6eQF/
This RegEx should do what you want: ([a-zA-Z0-9\-\_\ \'\"]+\,){3}[a-zA-Z0-9\-\_\ \'\"]+
You can also do it with split() as Vinod mentioned. In PHP you have split()/explode() as well.

How to remove the meta data field from multi id queries

I am using the open_graph Explorer tool to test this out and I need to be able to get the first_name, last_name and installed from 1000 users. At the moment I group up the users in grouped of 50 for a single query and batch them into up to 20 queries in a batch request.
A single query looks as follows
?ids=100003825998801,100003825998802,547884299,100003825998803,100003825998804,100003825998805,100003825998806&fields=first_name,last_name,installed
Now, the question is, when you use multiple ids in a single query like I did, facebook seems to "force" certain fields on you, large fields, such as "metadata" and "fields". Is it possible to remove these fields from the result set of the query?
Also, any advice on how to make this more efficient would also be great.
Thank.
Have you considered using FQL instead …?
SELECT first_name, last_name, is_app_user FROM user
WHERE uid IN (100003825998801,100003825998802,547884299,100003825998803,
100003825998804,100003825998805,100003825998806)
– that gives you just the info you want, you only have to watch out for the fact that the installed field is named is_app_user in FQL.