cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AshishJaiswal
Post Patron
Post Patron

If hyperlink exists condition

Hi Expert,

 

I am sure this would be simple but I am not able to figure it out (new to powerapps)

 

I am using a form to display data from sharepoint

 

one of the field in sharepoint will have a hyperlink in it

 

My condition is that the text box in form should show the hyperlink if available if not then show 'NA'

 

AshishJaiswal_0-1634744638119.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
Gorilla_8
Impactful Individual
Impactful Individual

@AshishJaiswal 

 

Try more simple

 

Put a HTML Text and put this code:

"<a href=" & DataCardValue53.Text & ">Click here</a>"

 

And on the OnVisible property:

If(!IsBlank(Yourhtml.Text),true,false)

View solution in original post

8 REPLIES 8
Gorilla_8
Impactful Individual
Impactful Individual

@AshishJaiswal 

 

Try:

If(!IsBlank(Yourlink), Showthelink, "NA")

OnVisible this code 

@Gorilla_8 

I am using this in the htmltext box - but it is not working

Value should be valided from datacardvalue43.text

 

If(!IsBlank(DataCardValue43.Text),"<a href=" & DataCardValue53.Text & ">Click here</a>","NA")

 

Gorilla_8
Impactful Individual
Impactful Individual

@AshishJaiswal 

 

Try more simple

 

Put a HTML Text and put this code:

"<a href=" & DataCardValue53.Text & ">Click here</a>"

 

And on the OnVisible property:

If(!IsBlank(Yourhtml.Text),true,false)

View solution in original post

Gorilla_8
Impactful Individual
Impactful Individual

@AshishJaiswal 

 

Or you can try:

OnVisible

 

If(!IsBlank(DataCardValue43), true, false)

 

 

And on the Text

 

If(!IsBlank(DataCardValue43.Text),"<a href=" & DataCardValue53.Text & ">Click here</a>","NA")

 

timl
Super User
Super User

Hi @AshishJaiswal 

Can you clarify what's not working? Is it the case that the link appears correctly but isn't clickable?

If so, one thing to check is that the DisplayMode of the card that contains your HTML text control is set to Edit.

https://powerusers.microsoft.com/t5/Building-Power-Apps/Launch-Function-not-working-inside-a-DataCar...

 

Hi @AshishJaiswal :

I've made a test but it worked well on my side:

vbofengmsft_0-1634797552878.png

 

vbofengmsft_1-1634797575817.png

vbofengmsft_2-1634797592419.png

vbofengmsft_3-1634797597131.png

Could you describe the problem you encountered in detail?

Could you please tell me what he meaning of available is?(My condition is that the text box in form should show the hyperlink if available if not then show 'NA')

What are the specific conditions of NA you want to show? Do you need to verify if the value of datacardvalue43.text is in URL format?

Best Regards,

Bof

 

HTML Text 

"<a href=" & DataCardValue53.Text & ">Click here</a>"

and visible property as 

 

If(!IsBlank(Yourhtml.Text),true,false)

But it is not showing 'NA'

 

I tried below 

Visible - 

If(!IsBlank(DataCardValue43), true, false)

 and text as 

If(!IsBlank(DataCardValue43.Text),"<a href=" & DataCardValue53.Text & ">Click here</a>","NA")

 

This does not work - it shows 'click here for all' - regardless if the value is present or not

 

 

My understand is that

 

We shouldn't be playing with the visible property as if link available t will show the link if not available it will show 'NA'. - in both scenario visible property should be true.

Now about the text property i tried this 

If(IsBlank(DataCardValue43.Text),"<a href=" & DataCardValue53.Text & ">Click here</a>","NA")

But it is not working

Hi @AshishJaiswal :

This has nothing to do with the visibility of the control, it only depends on whether the judgment condition in the If statement is true.for example:

Even if DataCardValue43 is not visible, if the value of DataCardValue43.Text is not empty, the value of IsBlank(DataCardValue43.Text) is still false.

In the final analysis, what conditions do you want to show "NA" when met, can you specify? For example:
DataCardValue43 is not visible or the value of DataCardValue53.Text is empty.

If you need to determine whether the visibility of DataCardValue43 and the value of DataCardValue53 are empty at the same time, then you can try:

If(IsBlank(DataCardValue43.Text)||IsBlank(DataCardValue53.Text),"<a href=" & DataCardValue53.Text & ">Click here</a>","NA")

 Best Regards,

Bof

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

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