cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MN003
Post Patron
Post Patron

Approval Error - Creating a shared OneDrive link for SharePoint list attachments

Hello,

 

I'm looking to use Power Automate to create a shared OneDrive link for attachments that end users upload to a SharePoint list so that approvers can click this link to review and make and edits or comments necessary in OneDrive then approve or reject the actual approval. If this is not possible using a SharePoint list, is it possible using a SharePoint document library?

 

So far I've received an error on the create share link step and I'm not sure what to do next.

 

MN003_0-1614348110443.png

Appreciate any thoughts or guidance. Thank You.

 

19 REPLIES 19
tom_riha
Super User
Super User

Hello @MN003 ,

I think the action 'Create share link' needs the document Id (unique identifier), not path to the file. Check the available dynamic content for the document Id.



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]

Sure here are my current options in the dynamic content:

As I scroll through I'm not seeing what I need and I know what you mean.

 

MN003_1-1614370518927.png

 

Here is the beginning of the flow as well.

MN003_2-1614370688715.png

 

Hello @MN003 ,

I'd try the 'Id', that says in the description that it's the file identifier.

image.png



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]

Morning Tom,

 

I tried that exact dynamic content and still have no luck 😞

Hello @MN003 ,

I now noticed you're using the OneDrive action to create the sharing link but the attachment is stored in SharePoint. You should either upload the attachment to OneDrive and then create the sharing link, or you should use the SharePoint action to create it if the file stays in SP.



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]

I see, since the users will be uploading via SP, which SP action would you recommend to create the sharing link that I can set as an email attachment?

I'd try the 'Create sharing link for a file or folder'.

image.png



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]

the issue I run into is that it only gives me an option to select a library but I'm trying to do it for a list. is there an action for a list?

I don't think there is, the document to share must be in a document library.



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]

That's a bummer, I'll try to see if I have success using a document library instead and will reply back.

MN003
Post Patron
Post Patron

I think I may be close. I'm able to get the OneDrive link working in my list but I get an error when it comes to displaying the attachment as a OneDrive attachment. Any ideas I could try?OneDrive Flow.jpgOneDrive Flow 2.jpg

Hello @MN003 ,

the error message talks about the 'Send email with options' action, that it's missing some input data.



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]

Hi Tom, 

My Send email with options has the required fields filled in and I'm not sure why the error still occurs.

MN003_0-1615485919744.png

 

Hello @MN003 ,

I'd try to add a 'Compose' actions before the 'Send email with options' action and store all the dynamic contents you use in that action in them. You'll then see in the run history if some of the dynamic contents you use isn't empty.



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]

Thank you Tom, I was able to resolve the email issue. To my original issue this is what I'm trying to achieve in Power Automate by sending an email with this SharePoint/OneDrive attachment. I've been able to get the create sharing link working and pasted into the body of the email but I'm just not sure how to get the email to reflect that link as an attachment.

 

MN003_0-1615551767758.png

 

Hello @MN003 ,

I'd try 2 things:

  1. Check if the 'varFileContents' has a value
  2. Switch the 'Name' and 'ContentBytes' order when building the variable, to have the 'Name' first and then the 'ContentBytes'


[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]

Sure and thank you for the suggestion, I tried it out but still got a local copy of the document in the email.

Maybe it's some Outlook stuff that an email can't contain 2 files with the same name, one from OneDrive and the other one attached, otherwise I'm out of ideas.



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]

I see, I will continue to play around with it. At least I can work with the 'Create sharing link for a file' action. Hopefully that can be added as an easier "email attachment type step" in the future as additional options that we can modify in the "send an email" step. 

 

Tom thank you for all your help with trying to find a solution for this. I greatly appreciate your time.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (5,142)