Showing results for 
Search instead for 
Did you mean: 
New Member

IF Statement with Launch Function for making a phone call

Hey Community friends,

I have built an Emergency Contacts List App and I have programmed a phone Icon to dial out to a work cell phone but if there is a contact that does not have a work phone it will launch with a blank field in the phone app.. 


I am curious to know if I can handle a phone number selection via an IF statement? I tried this but get a warning for "incompatible type" yet they are both phone numbers? 



WorkCellPhone_DataCard1.Default = true,
Launch("tel:" & WorkCellPhone_DataCard1.Default),
Launch("tel:" & PersonalCellPhone_DataCard1.Default)



Alternatively I found I can add an icon/button per individual contact and manually code it one by one but that will take a while...


Any suggestions are appreciated! 

Super User
Super User

There some issues:

1. You should be referring to dacardvalue not the Datacard

2. End the Datacaradvalue with text not Default

3. I tried changing the logic to if The Datacaradvalue is blank. Although not sure if that is what you want to achieve. Because putting is true mean the Datacaradvalue contains the word true


If( !IsBlank(WorkCellPhone_DataCardValue.Text), Launch("tel:" & WorkCellPhone_DataCardValue.Text), Launch("tel:" & PersonalCellPhone_DataCardValue.Text) )


If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Helpful resources

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.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (1,542)