In a SharePoint list, there is a field called Attachments where you can attach multiple files. These files are uploaded into the SharePoint site.
Suppose you want to share the attachment in Teams or mail — you have the option of Get attachments or Get attachment contents in Power Automate, as you can see below.
The Get Attachments action has a property that gives you the link to the attachment as you can see below.
But if you incorporate this URL in a Teams message or Outlook action, clicking it will download the file to your desktop. What if you want to open it in SharePoint instead?
Currently there is no built-in provision to open the attachment URL directly in SharePoint. But there is a workaround.
This makes sure the attachment link will open in SharePoint rather than being downloaded.
Important: If the file name contains spaces, the URL will not work. You need to replace spaces with %20 due to URL encoding.
Once this is done, the output will generate the correct URL that opens the attachment directly in the SharePoint list.