cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Banker_102
Level: Powered On

Hyperlink for attached item

Hi all,

 

I have a SharePoint list where each list item has an associated attachment. I'd like to create a column that displays a hyperlink to open that attachment (they are pdf's). I created a column called "Hyperlink" and set the type to Hyperlink. I used PowerApps to change the Default field of this column to:

 

First(ThisItem.'{Attachments}').AbsoluteUri

 

Unfortunately the column shows as blank even after attaching a pdf to a list item. When I view the item, I can see the attached PDF and the text of the hyperlink shows up properly. How can I get this to show up properly as a hyperlink in my list view?

9 REPLIES 9
Community Support Team
Community Support Team

Re: Hyperlink for attached item

Hi @Banker_102 ,

 

I just tested with below formula and it works:

Insert a Label control inside the data card of Hyperlink column and set its Text property to:

First(ThisItem.Attachments).AbsoluteUri

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Super User
Super User

Re: Hyperlink for attached item

I know you may have your reasons but have you thought about using Launch() to open the attachment. It will then just open it in a separate tab to give them the ability to download it or print it. 

 

I have several that I just put the attachments in a gallery and they can click to download it and they work pretty good. See mine below when they click the document name (a sharepoint attachment) it downloads the pdf for them.

 

ReviewApp.JPG

Maria_Geek
Level: Powered On

Re: Hyperlink for attached item

Forgive me for being lost, but where can I 'Insert a Label control' on a column in the List?

 

I attempted to put in the Custom Formatting, but I'm missing how that JSON should be as well.

 

Any feedback is appreciated.

Super User
Super User

Re: Hyperlink for attached item

@Maria_Geek 

 

Do you mean in your gallery? Or you are talking about writing back to you data source?

Maria_Geek
Level: Powered On

Re: Hyperlink for attached item

Don't want to write to the data source, just to make the link available after attachment is complete.

 

Attaching file with MS Flow and with row added to List and .pdf attached, want to have a column with a link to attachment as requested above.  But I'm missing something.

Super User
Super User

Re: Hyperlink for attached item

@Maria_Geek 

 

The example above is a SharePoint List as the data source and is just using the built in Attachments field that is there for each item on the SP List. 

 

Then the gallery is listing the attachments for the item that is selected in the other gallery to the left. Once you select the specific document that is attached you can download or view in the PDF viewer. 

 

You can probably do what you are asking to do if you put in a  column that is Multiline and plain text (if you are using a SP List) and put the hyperlink there. I store my signatures in that column and it should work the same. You can use Flow to put that data there...just depends on what you are using to get the document into flow. I haven't done it that why in a long time so I don't remember the specifics right off.

Highlighted
Maria_Geek
Level: Powered On

Re: Hyperlink for attached item

That's where I've been.  I can edit the JSON in formatting the column and build a hyperlink with the filename captured in @currentField.  Only I can't figure out how to get the ID number for ThisItem available inthe JSON code.

 

{
"$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
"elmType": "a",
"txtContent": "@currentField",
"attributes": {
"target": "_blank",
"href": "='https://XXXXXXXXXXXXXXXXXXX.com/sites/Fax-Rich/Lists/Outbound/Attachments/'+ @ItemId + '/' +@currentField + '?web=1'"
}

Super User
Super User

Re: Hyperlink for attached item

I can't tell by looking at this part but basically you need something to "Get Item"...just depends on your trigger and then you could use the "Compose" to create a variable for that item ID or Title or whatever you choose to use. 

 

I'm not sure exactly what you doing with this but from what I have gathered so far I really don't think that using JSON would be needed. 

Maria_Geek
Level: Powered On

Re: Hyperlink for attached item

Thanks @rebeccas .  I created a new post and included a full image.  

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

SecondImage

PowerApps Monthly Community Call

Next Wednesday, September 18th at 8am PDT

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Users Online
Currently online: 124 members 4,111 guests
Please welcome our newest community members: