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

Linking Attachment on SharePoint List

I am creating list items through MS Flow and adding an attachment of a single .pdf with each item.  Then I need to be able to click to view the attachment easily.

 

The Column Formatting works, but need to understand how to capture the Item ID for the row to make it fully dynamic.  Any help would be appreciated.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support Team
Community Support Team

Re: Linking Attachment on SharePoint List

Hi @Maria_Geek ,

Do you want to get the List Item ID value dynamically for the "href" property in your column format JSON formula?

 

Based on the needs that you mentioned, I have made a test on my side, please take a try with the following workaround:10.JPG

The JSON data formula as below:

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
  "elmType": "a",
  "txtContent": "@currentField",
  "attributes": {
    "target": "_blank",
    "href": "='https://xxxxxx.sharepoint.com/sites/PowerApps/Lists/20190503_case5/Attachments/' + [$ID] + '/' + @currentField"
  }
}

On your side, if you want to get the Item ID value dynamically, please use the following:

[$ID]

Please modify your formula as below:

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

Please take a try with above formula, 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.
2 REPLIES 2
Highlighted
Community Support Team
Community Support Team

Re: Linking Attachment on SharePoint List

Hi @Maria_Geek ,

Do you want to get the List Item ID value dynamically for the "href" property in your column format JSON formula?

 

Based on the needs that you mentioned, I have made a test on my side, please take a try with the following workaround:10.JPG

The JSON data formula as below:

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
  "elmType": "a",
  "txtContent": "@currentField",
  "attributes": {
    "target": "_blank",
    "href": "='https://xxxxxx.sharepoint.com/sites/PowerApps/Lists/20190503_case5/Attachments/' + [$ID] + '/' + @currentField"
  }
}

On your side, if you want to get the Item ID value dynamically, please use the following:

[$ID]

Please modify your formula as below:

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

Please take a try with above formula, 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.
Maria_Geek
Level: Powered On

Re: Linking Attachment on SharePoint List

Thank you so much.  I truly appreciate it.

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: 77 members 4,478 guests
Please welcome our newest community members: