cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
VGoncalves
Frequent Visitor

Send email with approval from PowerApps with attachments

Hello,

 

I have a Powerapps where people add their expenses of the month. When the user submit this, it triggers a flow that will send and email asking the approval from his/her superior.

 

There are 2 major expenses that the user will submit. Because of the difference of the content, i have 2 list in sharepoint that are update. Each type of expense, in the app, are in different pages, and different collections too.

After submiting their expenses and before sending an email to the superior. For each temporary collection created from the use information i have a flow that creates a CSV file, so i always have 2 CSV files for each user (but the names of each file is the same, independently of the user)

 

Until this part im ok.

 

But now is where is tricky for me.

 

In the approval email i want to send this 2 CSV files attached... im looking and i don't find anywhere how can i send an email from powerapps.

 

This is what i got:

VGoncalves_1-1606325888456.png

 

 

What do i put on the field "attachment name" and "attachements Content"?

 

Can anyone help me? Thank you

1 ACCEPTED SOLUTION

Accepted Solutions
v-siky-msft
Community Support
Community Support

Hi @VGoncalves ,

 

Try to use 'Find files in folder' action to search a find by its FileName, and then in the File field of 'Get File Content' action, use the following expression to get the file identifier.

body('Find_files_in_folder')?[0]['Id']

Snipaste_2020-11-27_11-39-52.png

Hope this helps.

Sik

View solution in original post

3 REPLIES 3
v-siky-msft
Community Support
Community Support

Hi @VGoncalves ,

 

Where are CSV files stored?

If they are stored in SharePoint or OneDrive storage, just use appropriate Actions to get the file contents.

For instance, if the file is stored in SharePoint Library, the flow steps are as follows.

First, use 'Get file properties' step in order to get the file identifier and File name, notice that Id should be passed from PowerApps in your case. 

Second, 'Get file content' based on file identifier.

Third, Put 'File Name with Extension' and File Content into the Attachment field.

get file content from SharePoint Libraryget file content from SharePoint Library

If you have to attach multiple files, find more information from here.

 

Hope this helps.

Sik

VGoncalves
Frequent Visitor

My file is storage on OneDrive.

I see on the actions of OneDrive the "Get file Content", but dont have the "Get file properties", what would be the actions on One Drive?

 

On the OneDrive i was seeing the action Create a share link, and put the link on the email as a workaround 😅

But would prefer put it fisically on the email.

 

Thank you for the help 🙂

v-siky-msft
Community Support
Community Support

Hi @VGoncalves ,

 

Try to use 'Find files in folder' action to search a find by its FileName, and then in the File field of 'Get File Content' action, use the following expression to get the file identifier.

body('Find_files_in_folder')?[0]['Id']

Snipaste_2020-11-27_11-39-52.png

Hope this helps.

Sik

View solution in original post

Helpful resources

Announcements
MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MSFTBizAppsLaunchEvent

Experience what’s next for Power Virtual Agents

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Users online (59,343)