cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Kudo Kingpin
Kudo Kingpin

Launch URL question

Hi there,

 

Looking for an advice?

 

I have my Share Point list with a column with all my vendors website. Most of the vendors has the URL not properly inserted i.e.:

 

vendor1.com

www.vendor2.com

http://vendor3.com  etc etc

 

I have an icon in my app that Launch the URL, but this icon only works if the value in my label is properly set to:

http://anyvendor.com

 

Is there any way to fix this?

 

Or should I add manually the prefix in my sharepoint list? 5000 vendors OMG!!

 

Thanks in advance for any response,

 

Regards

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Super User
Super User

Re: Launch URL question

Hi @sajarac 

 

There are two ways to get around this

 

First way:

I would use a Flow to get the url's for all the items, and then trim the left if the left starts with http://www. or https://www. or www.

Then once all of your url's are the same you could do:

 

 

Launch("http://www." & URLFIELD)

 

 

 

Second way:

In your code for the launch, you could do:

 

 

If(
   //if item starts with https then launch link
   Left (ThisItem.HyperlinkColumn,8) = "https://",
   Launch (ThisItem.HyperlinkColumn),
   
   //if item starts with http then launch link
   Left (ThisItem.HyperlinkColumn,7) = "http://",
   Launch (ThisItem.HyperlinkColumn),

   Left (ThisItem.HyperlinkColumn,3) = "www",
   Launch ("https://" & ThisItem.HyperlinkColumn),
   
   //otherwise launch URL with HTTP in front
   Launch ("http://www." & ThisItem.HyperlinkColumn)
)

 

 

 

 

 - I would probably use the second way with this, as it allows for various without having to do lots of data edits

 

Let me know if that works for you 😺

 

Cheers,

Sancho


@iAm_ManCat

Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


View solution in original post

Highlighted
Super User
Super User

Re: Launch URL question

(EDIT - Edited formula slightly!)


Hey @sajarac 

 

Yes, you could concat, OR, you could just use the following link format if the fields are all part of the same datasource in that gallery:

 

 

Launch(
       "https://www.google.com/maps/place/"
       &
       ThisItem.Address & ",+"
       &
       ThisItem.City & ",+"
       &
       ThisItem.State & ",+"
       &
       ThisItem.ZipCode
)

 

 

Could you give that a try and let me know if that works for you?

 

Thanks!

Sancho


@iAm_ManCat

Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


View solution in original post

11 REPLIES 11
Highlighted
Super User
Super User

Re: Launch URL question

Is it consistent? For example they ALL would work if you just had the www. in front of them? 

 

If it is consistent you could try doing : Lauch(Text("www." & ThisItem.URL))

Highlighted
Super User
Super User

Re: Launch URL question

Hi @sajarac 

 

There are two ways to get around this

 

First way:

I would use a Flow to get the url's for all the items, and then trim the left if the left starts with http://www. or https://www. or www.

Then once all of your url's are the same you could do:

 

 

Launch("http://www." & URLFIELD)

 

 

 

Second way:

In your code for the launch, you could do:

 

 

If(
   //if item starts with https then launch link
   Left (ThisItem.HyperlinkColumn,8) = "https://",
   Launch (ThisItem.HyperlinkColumn),
   
   //if item starts with http then launch link
   Left (ThisItem.HyperlinkColumn,7) = "http://",
   Launch (ThisItem.HyperlinkColumn),

   Left (ThisItem.HyperlinkColumn,3) = "www",
   Launch ("https://" & ThisItem.HyperlinkColumn),
   
   //otherwise launch URL with HTTP in front
   Launch ("http://www." & ThisItem.HyperlinkColumn)
)

 

 

 

 

 - I would probably use the second way with this, as it allows for various without having to do lots of data edits

 

Let me know if that works for you 😺

 

Cheers,

Sancho


@iAm_ManCat

Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


View solution in original post

Highlighted
Kudo Kingpin
Kudo Kingpin

Re: Launch URL question

1000's Kudos for you.

 

Thank you thank you!!!

 

The second way did the trick.

 

Regards,

Highlighted
Kudo Kingpin
Kudo Kingpin

Re: Launch URL question

@iAm_ManCat , Good morning!

 

And sorry to bother you again. Another quick question?

 

If I have my vendor address in 4 different fields i.e

Address

City

State

ZipCode

 

And I would like to "Launch" in order to get the map location, so I guess I will need to concatenate? How the formula will be?

 

thanks again for any response

 

Regards, 

Highlighted
Super User
Super User

Re: Launch URL question

(EDIT - Edited formula slightly!)


Hey @sajarac 

 

Yes, you could concat, OR, you could just use the following link format if the fields are all part of the same datasource in that gallery:

 

 

Launch(
       "https://www.google.com/maps/place/"
       &
       ThisItem.Address & ",+"
       &
       ThisItem.City & ",+"
       &
       ThisItem.State & ",+"
       &
       ThisItem.ZipCode
)

 

 

Could you give that a try and let me know if that works for you?

 

Thanks!

Sancho


@iAm_ManCat

Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


View solution in original post

Highlighted
Super User
Super User

Re: Launch URL question

I use what @iAm_ManCat  with a slight variation (and I can't remember now why it was..lol). 

 

I use:

 

Launch("https://www.google.com/maps/place/" &

Substitute(ThisItem.Address1," ","+") & ",+"&

Substitute(ThisItem.City," ","+") & ",+"&

Substitute(ThisItem.State," ","+") & ",+"&

Substitute(ThisItem.Zip," ","+"))

 

I only used it on one and have not really had a need for it since.

Highlighted
Super User
Super User

Re: Launch URL question

@rebeccas I know exactly why 😺 - the URL-reader for google maps used to be very unforgiving with commas and spaces, but now even if the address has double, triple or more commas between each field when launched it will still find the same address:

 

https://www.google.com/maps/place/100+Spectrum+Center+Dr,,+Irvine,,,+CA,,,,+92618,,,,, 

 

https://www.google.com/maps/place/100 Spectrum Center Dr,, Irvine,,, CA,,,, 92618,,,,,  

 


@iAm_ManCat

Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


Highlighted
Super User
Super User

Re: Launch URL question

@iAm_ManCat 

 

Thanks for that! I will try and keep in mind that I don't need all that extra next time I use it...the cleaner and simpler the better!!

Highlighted
Kudo Kingpin
Kudo Kingpin

Re: Launch URL question

@rebeccas @iAm_ManCat 

 

Thank you both for your prompt response!!!

 

I really appreciate it.

 

Regards. 

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (13,662)