cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Sharepoint List: Hyperlink using PowerApps form

I have one sharepoint list and have one field as hyperlink. I have customized this list using PowerApps. The hyperlink field is not taking the link in view form in shrepoint i.e., when i click the hyperlink field in view form, it should redirect to with respective url but it is not taking as a link in viewform but its working in editform. Could you please suggest me that how to configure (the link to open in view form) in PowerApps.

1 ACCEPTED SOLUTION

Accepted Solutions

Hi Shruthi,

 

Try this approach.

 

In your form, select the hyperlink field and unlock the datacard.

SelectField.PNG

 

Now add HTML text field to the selected data card and rename it something like 'hyperlink'. Set its properties like X,Y,Height and Width etc. similar to DataCardValue field.

AddLink.PNG 

 

Set below properties for new field-

 

Set "HTMLText" (Make sure to replace datacardvalue with correct value)

Concatenate("<a href='",DataCardValue3.Text,"'>",DataCardValue3.Text,"</a>")

 

Set "Visible" (Make sure to replace form name with correct value)

If(SharePointForm1.DisplayMode = DisplayMode.View,true,false)

 

Set "AutoHeight" to True

 

Set "Visible" property of DataCardValue to below code.

If(SharePointForm1.DisplayMode <> DisplayMode.View,true,false)

 

Save and publish your form. Now your View form will display link while Edit/New form will display textbox.

 

Hope this helps.

 

 

View solution in original post

10 REPLIES 10
v-yutliu-msft
Community Support
Community Support

Hi @Anonymous ,

Do you mean that after you customize form in PowerApps,you can not redirect to with respective url by clicking hyperlink field?

The reason why you met this problem is that in PowerApps,  hyperlink field will be added in textinput control by default.

Textinput control can only used to edit and display data, can not be seen as a link to click.

I suggest you use a launch button to redirect to with respective url.

What's more, if you add the button inside the form, when the form's mode becomes view, the button will become disabled too.

So I suggest you add the button outside the form to avoid the affect of form's mode.

 

I've made a similar test for your reference:

1)set the SharePointIntegration's OnView:

Navigate(FormScreen1);ViewForm(SharePointForm1)
//navigate to the screen, not just the form

2)insert a launch button outside the form

set the button's OnSelect:

Launch(DataCardValue8.Text)
//DataCardValue8 is the textinput name of the hyderlink field,
please replace it with your textinput control

10293.PNG

 

Then the button's mode will not be affected by the form's mode.

You could click the button to launch the link no matter in edit form or view form.

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Hi @v-yutliu-msft 

 

I have used one button name as "Open" and i had set the button's OnSelect value as "Launch(DataCardValue1.Text)". This will work in edit mode not in view mode in SharePoint list. I need this hyperlink should work in view mode as well. Because for this list, we have given edit access for few users and other users have only read access. Read access users will be able to see the form and if they want to open the link in view form, they should open the link using button. 

I have attached the screenshots of edit mode and view mode.

 

Hi Shruthi,

 

Try this approach.

 

In your form, select the hyperlink field and unlock the datacard.

SelectField.PNG

 

Now add HTML text field to the selected data card and rename it something like 'hyperlink'. Set its properties like X,Y,Height and Width etc. similar to DataCardValue field.

AddLink.PNG 

 

Set below properties for new field-

 

Set "HTMLText" (Make sure to replace datacardvalue with correct value)

Concatenate("<a href='",DataCardValue3.Text,"'>",DataCardValue3.Text,"</a>")

 

Set "Visible" (Make sure to replace form name with correct value)

If(SharePointForm1.DisplayMode = DisplayMode.View,true,false)

 

Set "AutoHeight" to True

 

Set "Visible" property of DataCardValue to below code.

If(SharePointForm1.DisplayMode <> DisplayMode.View,true,false)

 

Save and publish your form. Now your View form will display link while Edit/New form will display textbox.

 

Hope this helps.

 

 

Anonymous
Not applicable

Hi Danishlslam,

 

It works!. Thanks a lot.

Hi @DanishIslam,

I'm trying your solution for this but can't make it work? have things changed since you posted this?

Hi

This was very helpful thank you. Can I ask how I would add a statement or parameter to the below statement that would force center alignment of the text populated in the newly created HTML text box? Not the Box itself but the contents.

Concatenate("<a href='",DataCardValue3.Text,"'>",DataCardValue3.Text,"</a>")

Since this is an html textbox, you can leverage html elements like div, span etc. and write inline css to center align your content. hope this helps.

Hi

Thank you, would you be able to show me an example of the syntax, I am very new to HTML coding.

Regards.

SwapnaMathew
Regular Visitor

Hi,

 

Instead of using a button, can we use an icon to launch the hyperlink in the respective Datacardvalue ? If so can you help me in that

 

Thank you.

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (3,805)