cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
rups921
Frequent Visitor

Search field some text to launch hard coded phone number

Is there a possibility to make something?
On the gallery, i've got a field with various text.
Is it then possible to make an if statement or containt or match to call a hard coded tel number?
 
Just like something
If(Contains "Some text";
Launch ("tel:xxxxxxxxxx")
1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: If field contact text run launch

@rups921 

Your example is very good and now I understand what you would like to do.

 

I assume you have some label/text input in your form.  When the label/text input is clicked a phone number will be called if it matches the name on a list.

 

Try this code in the OnSelect property of your label/text input.  You will need to customize for your own situation but I think it shows the concept very well.

 

If(
    "Apple" in Label1.Text,Launch("tel:6141234567"),
    "Google" in Label1.Text,Launch("tel:2049876543"),
    "Microsoft" in Label1.Text,Launch("tel:2325648976")
);

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

7 REPLIES 7
Super User
Super User

Re: If field contact text run launch

Are you just having an issue with writing the conditiondal statement for IF? You could try this.

If(Not(IsBlank(TextInput1.Text)); Launch("tel:xxxxxxxxxx"));;

—-
Please Accept as Solution if this post answered your question so others may find it more quickly. If you found this post helpful consider giving it a Thumbs Up.
rups921
Frequent Visitor

Re: If field contact text run launch

the above is intended for the entire text input? but I have 1 text box with a reasonable text and it has to look at part of the text.
so something with contains or match
Super User
Super User

Re: If field contact text run launch

It would be helpful if you can provide an exact scenario. Screenshots help too. I would be happy to help if it’s something I am familiar with.

Earlier I thought you just wanted to detect whether the field was blank, lol.
Highlighted
rups921
Frequent Visitor

Re: If field contact text run launch

Maybe this will help.

What i mean;

If the texfield (Viewmode) entry match like "Windows" then call windows.

If the entry contains "Apple" then call apple

 

 

Super User
Super User

Re: If field contact text run launch

@rups921 

Your example is very good and now I understand what you would like to do.

 

I assume you have some label/text input in your form.  When the label/text input is clicked a phone number will be called if it matches the name on a list.

 

Try this code in the OnSelect property of your label/text input.  You will need to customize for your own situation but I think it shows the concept very well.

 

If(
    "Apple" in Label1.Text,Launch("tel:6141234567"),
    "Google" in Label1.Text,Launch("tel:2049876543"),
    "Microsoft" in Label1.Text,Launch("tel:2325648976")
);

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

Community Support
Community Support

Re: If field contact text run launch

Hi @rups921 ,

Do you want to call different phone number (using Launch function) based on the "Uitvoerende Partij" column value in your Display form?

 

Based on the formula you provided, I think there is something wrong with it. There is no function called "Match" in PowerApps.

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

Set the OnSelect property of the DataCardValue60 ("Uitvoerende Partij" Label) in your Display form to following:

If(
   "Entelec" in ThisItem.'Uitvoerende Partij',
    Launch("tel:xxxxxxx"),
    "Entelec2" in ThisItem.'Uitvoerende Partij',
    Launch("tel:00000000"),
    ...
)

or

If(
   IsMatch(ThisItem.'Uitvoerende Partij', "Entelec"),
   Launch("tel:xxxxxxxx"),
   IsMatch(ThisItem.'Uitvoerende Partij', "Entelec2"),
   Launch("tel:00000000"),
   ...
)

 

Please consider take a try with above solution, check if the issue is solved.

 

Best regards,

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.
rups921
Frequent Visitor

Re: If field contact text run launch

Thanks! This one worked for me.

Even if i make a special button at tho bottom of the gallery :).

So now i can move on

 

Helpful resources

Announcements
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

Top Solution Authors
Top Kudoed Authors
Users online (9,552)