cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Resolver I
Resolver I

How to set up email notification after a user uploads a file from Power Apps to SharePoint Document Library?

Hi,

 

I followed Shane Young's video to upload files from Power Apps to SharePoint document library. Since I use Flow to upload the file, the file in SharePoint library always shows my name as file creator. Our college wants to send out an email notification to confirm the upload, but I cannot do it because there is no email information for the user who uploads the file originally. I wonder if there is a way we can set up an email notification or any confirmation message to the original user after the file has been successfully uploaded to the SharePoint document library.

 

Thanks in advance.

Pei

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Resolver I
Resolver I

Re: How to set up email notification after a user uploads a file from Power Apps to SharePoint Document Library?

@WarrenBelz  I have found a solution that works for me. I just found out that I can use the following commands (snip below) directly in original script. I must thank you for your suggestion to add Office365Outlook data source and use SendEmail command. This works for me, but it's a little hard to write a long well-formed email. So there are definitely some better solutions. Welcome to post here.

 

Pei

 

SendMailCommand.JPG

 

View solution in original post

Highlighted
Community Champion
Community Champion

Re: How to set up email notification after a user uploads a file from Power Apps to SharePoint Document Library?

Hi @ppei ,

That was actually my post a couple of items back. You might consider accepting this as a solution.

View solution in original post

18 REPLIES 18
Highlighted
Community Champion
Community Champion

Re: How to set up email notification after a user uploads a file from Power Apps to SharePoint Document Library?

Hi @ppei ,

I assume you are using Shane's variation on the Attachment control to grab the file. This will not get the creator's details, but if you knew it when you were saving the file, you could use Office365Outlook to send an email directly from Power Apps at the same time.

So expanding on this, the inbuilt function User().Email has the information - you just need to trigger it after a successful Flow run, which can be done by returning a Boolean from the Flow on success - instructions are here.

Happy to assist further if required.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

Highlighted
Resolver I
Resolver I

Re: How to set up email notification after a user uploads a file from Power Apps to SharePoint Document Library?

@WarrenBelz Thank you for your prompt rely and suggestion. Yes. I used Shane's method to create a Power App and Flow, and they work. I thought about using a trigger as well. I read the doc but I still don't get it.  I tried to use a label in Power Apps that uses user().email but I haven't figured out how to specify the label inside Run clause and return it to the Flow. Do you have an example how to do it?

Highlighted
Community Champion
Community Champion

Re: How to set up email notification after a user uploads a file from Power Apps to SharePoint Document Library?

Thanks @ppei ,

I actually have a better idea since the last post.

Simply add the below to your flow after the upload and send User().Email as the parameter. You will need to disconnect and reconnect the Flow to pick up the extra parameter requirement.

FlowUpload.png

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

Highlighted
Resolver I
Resolver I

Re: How to set up email notification after a user uploads a file from Power Apps to SharePoint Document Library?

@WarrenBelz  Thank you! I tested your solution. I never know that I can do that. Unfortunately, I got an error below. Are there any special for this email address? See below for my error.

 

SendMailError.JPG

 

 
Highlighted
Community Champion
Community Champion

Re: How to set up email notification after a user uploads a file from Power Apps to SharePoint Document Library?

Hi @ppei ,

Hard-code the address in the Flow and see if that works.

You can also use Office365Outlook.SendEmail from PowerApps, but would need to do that without the test if you cannot get the confirmation back from the Flow (as you have mentioned).

Highlighted
Resolver I
Resolver I

Re: How to set up email notification after a user uploads a file from Power Apps to SharePoint Document Library?

Hi, @WarrenBelz Thank you again! I got the same error  with my hard-code email address. I could not find Power Apps send email so some reasons. 

Highlighted
Community Champion
Community Champion

Re: How to set up email notification after a user uploads a file from Power Apps to SharePoint Document Library?

Ok @ppei ,'

I suspect something is different in your Office365 Outlook setup - what mail service do you use?

Also in PowerApps, choose View > Data Sources and type Office in the search bar. You should see Office365Outlook.

Choose this and connect.

Then put in a button and put this in the OnSelect (replace with your email address) press it and see if you get the email.

Office365Outlook.SendEmail("youremailaddress","Test Subject","Test Body")

 

Highlighted
Resolver I
Resolver I

Re: How to set up email notification after a user uploads a file from Power Apps to SharePoint Document Library?

@WarrenBelz We are using Office 365. I had not added any data source for the app. I just added Office 365 Outlook data source but still got the same error. Thank you and you have a good evening!

Highlighted
Community Champion
Community Champion

Re: How to set up email notification after a user uploads a file from Power Apps to SharePoint Document Library?

@ppei ,

When you say got the same error, was this on adding the connection or sending the email - can you please send me a screenshot of the error.

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Robotic Process Automation

Let's talk about the solution provided by Microsoft for Robotic Process Automation (RPA)

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

Top Solution Authors
Top Kudoed Authors
Users online (6,194)