I have a requirement to grab a file from a SharePoint site and attach it to an email. The end user provides the URL to the file, and power automate handles the rest. Originally, I was working with a specific "style" of URL and I was able to correctly parse the URL to get the file content.
Style A: https://XXX.sharepoint.com/:b:/r/sites/XSITE/cos_reviewrequest/ARTS/REQ20039_3F3CF5E3265AED11A76E00155DA3F371/SAMPDQ_20221213.docx?csf=1&web=1&e=hNPWKA
However, I am not able to figure out how to use Power Automate with a different url, Style B.
Style B: https://XXX.sharepoint.com/:w:/r/sites/XSITE/_layouts/15/Doc.aspx?sourcedoc=%7B6E045BAE-6000-41E3-A8B8-EE3751D42F7B%7D&file=SAMPDQ_20221213.docx&action=default&mobileredirect=true
Style A is created using the "Share" or "Copy Link" command within SharePoint. Style B is created when you open an editable file and simply copy the URL from the address bar (which I'm finding is how most end users intuitively grab the link).
With Style A, I can parse the folder structure from the URL directly. This is left out of Style B, so I can't configure any of the Power Automate SharePoint integrations to work correctly. "sourcedoc" is a GUID and I thought I could make some use of that, but apparently that is not the File ID that Power Automate needs to work.
I'm open to any options, including custom REST scripts if I need to be. (Originally posted on Stack Overflow)