cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
NabeelNQ
Helper II
Helper II

Common input through Email or Phone Number

Hey Guys,

 

I want the user to input either their Email Address OR their phone number in .

 

I want to record the data in seperate fields.

 

I dont want to have two different input boxes, but I can have two buttons for the user to select, and then one common data entry box.

 

So when the user wants to log in, he / she can either type in their email or their phone number.

 

Thanks! 🙂

1 ACCEPTED SOLUTION

Accepted Solutions
v-xida-msft
Community Support
Community Support

HI @NabeelNQ,

Could you please share a bit more about your scenario?

Do you want to store/record the entered data (email address or photo number) into separated columns within your data source based on email or photo number?

Before you record/store the entered data into your data source, you need to check if the entered data is email or photo number within your app firstly.

I have made a test on my side, please take a try with the following workaround:5.JPG

 

6.JPG

Set the OnSelect property of the "Using E - Mail" button and "Using Photo Number" button both to following:

If(
    IsMatch(TextInput1.Text, Match.Email), 
    Patch('20181220_case2', Defaults('20181220_case2'),{Title:"PowerApps Registeration", Email:TextInput1.Text}),
    Patch('20181220_case2', Defaults('20181220_case2'),{Title:"PowerApps Registeration", PhotoNumber:TextInput1.Text})
)

On your side, you should type:

If(
    IsMatch(TextInput1.Text, Match.Email), 
    Patch('YourSPList', Defaults('YourSPList'),{Title:"PowerApps Registeration", EmailColumn: TextInput1.Text}),
    Patch('YourSPList', Defaults('YourSPList'),{Title:"PowerApps Registeration", PhotoNumberColumn: TextInput1.Text})
)

Please check the attached GIF screenshot for more details:

 

More details about the IsMatch function in PowerApps, please check the following article:

IsMatch function

 

In addition, if you take a try with above solution I provided, I think it is not necessary to add two Buttons ("Using E-Mail" and "Using Photo Number") within your app, you only need to add a single one button to submit your entered data.

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-xida-msft
Community Support
Community Support

HI @NabeelNQ,

Could you please share a bit more about your scenario?

Do you want to store/record the entered data (email address or photo number) into separated columns within your data source based on email or photo number?

Before you record/store the entered data into your data source, you need to check if the entered data is email or photo number within your app firstly.

I have made a test on my side, please take a try with the following workaround:5.JPG

 

6.JPG

Set the OnSelect property of the "Using E - Mail" button and "Using Photo Number" button both to following:

If(
    IsMatch(TextInput1.Text, Match.Email), 
    Patch('20181220_case2', Defaults('20181220_case2'),{Title:"PowerApps Registeration", Email:TextInput1.Text}),
    Patch('20181220_case2', Defaults('20181220_case2'),{Title:"PowerApps Registeration", PhotoNumber:TextInput1.Text})
)

On your side, you should type:

If(
    IsMatch(TextInput1.Text, Match.Email), 
    Patch('YourSPList', Defaults('YourSPList'),{Title:"PowerApps Registeration", EmailColumn: TextInput1.Text}),
    Patch('YourSPList', Defaults('YourSPList'),{Title:"PowerApps Registeration", PhotoNumberColumn: TextInput1.Text})
)

Please check the attached GIF screenshot for more details:

 

More details about the IsMatch function in PowerApps, please check the following article:

IsMatch function

 

In addition, if you take a try with above solution I provided, I think it is not necessary to add two Buttons ("Using E-Mail" and "Using Photo Number") within your app, you only need to add a single one button to submit your entered data.

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Thank you so much Kris, this was an awesome answer, with an awesome gif.

 

Really helped, thanks again! 🙂

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (2,915)