This feels so simple, to display the URL of uploaded attachments. My project involves adding items and attachments to an Azure SQL DB table. I have tried many approaches and one solution that seems to be possible requires that I display the URL path in a SharePoint column which can be store and recalled in the SQL table. This is the basic idea and I know the illustration only handles one upload. As you can guess, I can right-click and copy the image link, then paste into the AttachmentLink field, but that is madness.
Ideally, whatever I come up with also needs to populate On Load in the Edit view, so existing items that have Attachments will populate URLs once the item is opened in EDIT mode.
I have read many posts today that seem to relate but don't quite fit. I have played around with variations of this block below and tried adding a Hyperlink column to extract values from Attachments and populate to the Hyperlink column, but I need to ask if anyone out there has any wisdom to share. Many thanks.
fd.spRendered(function() {
var listLink = 'https://domain.com';
//getting the current item ID
var itemID = fd.itemId;
//getting the name of the first attached file
var fileName = fd.field('Attachments').value[0].FileName;
//setting the source of the Image control to the URL of the first attached fiel
fd.control('Image2').source = listLink + '/Attachments/' + itemID + '/' + fileName;
});