cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sajarac
Super User
Super User

Call option button

Hello guys, I have a field which is my vendor phone number, I've placed beside that fied a phone icon, and I would like to have the action once someone tap the icon make a phone call to that number.

 

Capture.JPG

1 ACCEPTED SOLUTION

Accepted Solutions

That's what I meant.

 

OnSelect = Launch("tel:"&TelNo) 

 

assuming TelNo is the column name. 

 

Whatever expression you have on the Textbox that displays the telephone number, you should be able to use that in place of TelNo in the expression above.

View solution in original post

14 REPLIES 14
murali
Power Apps
Power Apps

You could set the OnSelect action to

 

Launch("tel:1234567890")

 

Replace the phone number with the actual phone number. I tried it only on Windows desktop and it asked for me to choose the app. Let me know if this works.

 

Thanks

Murali

Hi Murali, didn't works because the number is stored in a column in excel, so I have 20 different vendors everyone witha different number, so can't be tied to a single number. 

 

Any other possible solution?

 

Many thanks

 

Sajarac

That's what I meant.

 

OnSelect = Launch("tel:"&TelNo) 

 

assuming TelNo is the column name. 

 

Whatever expression you have on the Textbox that displays the telephone number, you should be able to use that in place of TelNo in the expression above.

AsiaJo
Frequent Visitor

Good morning!

 

I have this function in place in my app but I am wondering if there is a way to add the pop up window that asks if the user would like to call the number they clicked. I worry that the way it is set up now, users will accidentally select a number not intending to call that employee. 

 

Thank you for your help!

Meneghino
Community Champion
Community Champion

Hi @AsiaJo

The way to do that is to create another screen which is a confirmation screen with a "Place call" button and a "Cancel" button.

Then the action in the original button should be just to navigate to this new screen.

Then in the new screen the "Place call" button OnSelect should be the Launch... expression and the "Cancel" button OnSelect should be Back().

Please let me know if anything is not clear.

AsiaJo
Frequent Visitor

Oh boy, that would be several additional screens in my app 😞 I was hoping we could recreate the pop up window that other apps currently use. Is there a limit to the number of screens powerapps supports? Also, are there other limitations such as the number of items an app can read?

 

Thank you!

Meneghino
Community Champion
Community Champion

Hi @AsiaJo this would be just one additional screen.  The is no out-of-the-box way of creating pop-ups in PowerApps, although you can do it with the single elements.  However, for mobile apps I have found it much easier to have a separate screen that you can navigate to from any of the other screens.

 

The trick to having just one additional screen is to pass the telephone number as a parameter to the screen, via a context variable.  In other words then code to call the screen would be something like:

Navigate(MyConfirmationScreen, Transition.None, {NumberToCall: MyTelNumberParameter})

Then in the confirmation screen, the place call button would just have Launch("tel:"&MyTelNumberParameter)

 

Please let me know if anything is not clear.

AsiaJo
Frequent Visitor

{NumberToCall: MyTelNumberParameter} 

 What does this portion of the code you entered do? 

 

I have several screens that have phone numbers on them. Is there a way to point all of these screens to one confirmation screen? It seems like that is what you are saying but I am new to coding so I want to make sure I input everything correctly.

 

Thanks!

Meneghino
Community Champion
Community Champion

That portion of code sets the context variable of the destination screen to the value MyTelNumberParameter.  The variable name is NumberToCall.  Please see here for more info:

https://powerapps.microsoft.com/en-us/tutorials/function-navigate/#syntax

 

Please note that context variables are valid for one screen only, this means that they can have the same name but different values for different screens.  This is why the parameter needs to be passed in the Navigate function.

 

Yes, what I am suggesting is the way to point everything to one confirmation screen.  Happy to help further.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Users online (3,180)