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

Dynamic URL based on User Input

Hello,

 

Requirement: User will input a phone number and the result should be a dynamic URL based on the user input.

 

Ex: User Input: 9998887777 - Output URL: +1-999-888-7777@qwerty.zxcv.org which is a MailTo: URL - user should be able to click on it and the default mail application opens up and pre-fills the "To" with this dynamic URL.

 

The input can only be a phone number and should be in XXX-XXX-XXXX format so validation required. If this is difficult, then may be add three separate boxes for user to enter the phone number in: XXX       XXX          XXXX and generate the URL.

 

Any ideas?

 

Thanks in advance!

1 ACCEPTED SOLUTION

Accepted Solutions
v-siky-msft
Community Support
Community Support

Hi @BB9 ,

 

Workaround 1- use three text box to validate the number

Set Format of three text box to Number, and set OnSelect property of mail icon as below:

Launch("mailto:" & Concatenate("+1-",TextInput1.Text,TextInput1_1.Text,TextInput1_2.Text,"@qwerty.zxcv.org"))

Snipaste_2019-12-27_13-32-16.pngSnipaste_2019-12-27_13-33-34.png

 

Work around 2 - Use IsMatch function to validate the number

Set Format of text box to Text, Set OnSelect of Mail icon as below:

If(IsMatch(TextInput1.Text,"\d{3}-\d{3}-\d{3}"),Launch("mailto:" & Concatenate("+1-",TextInput1.Text,"@qwerty.zxcv.org")),Notify("Invalid format",NotificationType.Error))

Snipaste_2019-12-27_13-58-37.png

Sik

View solution in original post

1 REPLY 1
v-siky-msft
Community Support
Community Support

Hi @BB9 ,

 

Workaround 1- use three text box to validate the number

Set Format of three text box to Number, and set OnSelect property of mail icon as below:

Launch("mailto:" & Concatenate("+1-",TextInput1.Text,TextInput1_1.Text,TextInput1_2.Text,"@qwerty.zxcv.org"))

Snipaste_2019-12-27_13-32-16.pngSnipaste_2019-12-27_13-33-34.png

 

Work around 2 - Use IsMatch function to validate the number

Set Format of text box to Text, Set OnSelect of Mail icon as below:

If(IsMatch(TextInput1.Text,"\d{3}-\d{3}-\d{3}"),Launch("mailto:" & Concatenate("+1-",TextInput1.Text,"@qwerty.zxcv.org")),Notify("Invalid format",NotificationType.Error))

Snipaste_2019-12-27_13-58-37.png

Sik

View solution in original post

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Users online (37,573)