Let's POWER Automate

From no-code to low-code

Menu
  • Expressions
  • Filters
  • General
  • Application specific solutions
    • Dataverse
    • Excel
    • Forms
    • Outlook
    • Planner
    • Power Apps
    • SharePoint
    • Teams
  • Triggers
  • Ready to use solutions
    • Approval Process Template
    • Task Delegation App
    • The Ultimate Power Automate expressions cheat sheet
    • Power Automate HTTP requests to SharePoint cheat sheet
    • Power Automate HTTP requests to Graph API cheat sheet
  • ABOUT ME
  • Get help with your flow
  • POWER PLATFORM SERVICES
Menu

Share SharePoint file to external email address (Power Automate)

Posted on December 10, 2023December 17, 2023 by Tom

“I’d like to share file only to specific external email addresses, not everyone with a link, is that doable in Power Automate flow?”


When sharing files with external users, Power Automate gives quite you limited possibilities. You can either share the file in your organisation, or to everyone with a link. The option to share only with people you choose, the option provided by SharePoint, isn’t there.

Power Automate file share external email

Yet that seems to be the more reasonable way of external sharing. Sharing files externally to everyone with a link seems a bit too excessive. Which brings us to the topic of this blog post – how to share files externally only to specific people?

Note: the solution is using Graph API – you’ll need a premium license to use it.

Use Graph API to share the files

Since the SharePoint actions won’t help you, and I didn’t find any useful http request to SharePoint, let’s do it using Graph API. But to use Graph you need more than just SP site url, library name, etc., you need their id’s.

All the actions below are the preauthorized Entra ID ‘Invoke an HTTP request’.

Get the SharePoint site id

The first id is the SharePoint site id. Send an http request where you search for your site among all the sites.

Method: GET

Uri: https://graph.microsoft.com/v1.0/sites?search=<SPsite>

Note: <…> is a placeholder, replace it including the < and >.

With the right search parameter it should return only the specific site. Extract its id with an expression.

first(body('Invoke_an_HTTP_request_-_site_id')?['value'])?['id']

Get the list id

With the site id you can search for the document libraries, called ‘drives’ when using Graph API. Use the request below where you find the library by name.

Method: GET

Uri: https://graph.microsoft.com/v1.0/sites/@{first(body('Invoke_an_HTTP_request_-_site_id')?['value'])?['id']}/drives?$filter=name eq '<libraryName>'

Note: <…> is a placeholder, replace it including the < and >.

Extract the library id to use it in the next request.

first(body('Invoke_an_HTTP_request_-_library_id')?['value'])?['id']

Get the file id

You’ll need also the id for the file as it’s not using the standard SharePoint id. In the example below it’s searching for the file using the file full name.

Method: GET

Uri: https://graph.microsoft.com/v1.0/sites/@{first(body('Invoke_an_HTTP_request_-_site_id')?['value'])?['id']}/drives/@{first(body('Invoke_an_HTTP_request_-_library_id')?['value'])?['id']}/items?$filter=name eq '<fileNameWithExtension>'

Note: <…> is a placeholder, replace it including the < and >.

Again, take the file id from the result.

first(body('Invoke_an_HTTP_request_-_file_id')?['value'])?['id']

Share the file with the email address

Once you have all the information from above, the SP site id, library id and file id, you can finally share it with the fourth http request.

Method: POST

Uri: https://graph.microsoft.com/v1.0/sites/@{first(body('Invoke_an_HTTP_request_-_site_id')?['value'])?['id']}/drives/@{first(body('Invoke_an_HTTP_request_-_library_id')?['value'])?['id']}/items/@{first(body('Invoke_an_HTTP_request_-_file_id')?['value'])?['id']}/invite

Body:
{
    "recipients": [
        {
            "email": "<emailAddress>"
        }
    ],
    "message": "<description in the invite>",
    "requireSignIn": true,
    "sendInvitation": true,
    "roles": [
        "<write | read>"
    ]
}
Power Automate file share external email

Note: <…> are placeholders, replace it including the < and >.

That’s it, the request will create a sharing link to a file that’ll be accessible only for the specific email address.

Power Automate file share external email

Summary

As I said many times before, if Power Automate doesn’t give you what you need, you might need an http request. In this case it’s sharing files only to specific external email addresses. Power Automate let’s you share file only within organisation or to everyone, but with the http requests to Graph API as explained above you can share it only to specific external email address.

It might be a bit more complicated solutions as you work with strange looking id’s, but in the end it’s only 4 http requests to collect all the information to get the job done.


πŸš€ Master Power Automate

Join 2,000+ professionals getting actionable Power Automate tutorials, solutions, cheat sheets & tips every week.

No spam. Unsubscribe anytime.

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

πŸš€ Master Power Automate

Join 2,000+ professionals getting actionable Power Automate tutorials, solutions, cheat sheets & tips every week.

No spam. Unsubscribe anytime.

Still exchanging emails to get things approved?

Use the Approval Process Template and the Task Delegation App to skip the hard part and deploy an automated, fully functional approval solution on a SharePoint list in minutes! And then the next one, and the next one...

Approval Template Preview ✨ Learn more ✨

Turn ideas into flows with ease!

Grab the complete Power Automate Cheat Sheet Bundleβ€”everything you need to master expressions, SharePoint HTTP calls, and Graph API in Power Automate.

Cheat Sheet Bundle Preview ✨ Get the Cheat Sheets

Didn't find what you were looking for?
Need to adjust a solution to fit your needs?
Or would you just like to get an assistance from somebody with thousands of hours of experience with Power Automate?

Power Automate blogs worth visiting

Damien Bird
Dennis (Expiscornovus)
Paul Murana

©2025 Let's POWER Automate | Theme by SuperbThemes