Showing results for 
Search instead for 
Did you mean: 
Frequent Visitor

Saving e-mails and attachments from Outlook to a folder with a specific name

Hello there,

we've had Office 365 since a few years now, yesterday I started playing with the Teams Apps to see what can I do with them and I came across Power Automate. Pretty quickly I understood its potential. I'm a Civil Engineer, I design structures, so I don't do any programming at work.


So the same day I found about this tool I came up with an idea to automate one task at the office we usually have to do. When we receive e-mails with attachments for a certain project we copy the e-mail and the attachment to a project "incoming" folder for storage (an additional precaution). The folder name is usually in the format "YYYYMMDD Title_of_the_e_mail".

So now I'm trying to use Power Apps to automate this task - I got to the point where I can save an e-mail to a folder with its name as the current date, the email copies itself there with the extension *.eml along with the attachment as a separate file. I do this using my onedrive now.


I have two problems:

1.How can I name the folder in the format "current date + title of the e-mail"? I tried creating two variables set as String type and use another variable to glue them together with the function 'concatenate', as seen on the screen:

The version where I only had the folder name worked when I inserted the line formatDateTime(utcNow(),'yyyy-MM-dd') as a function in the action where I type in the save-file destination: So I tried doing the same with the 'variable 3' - the variable where I use the function concatenate, as seen here:

And it didn't work 🙂 I admit I'm wandering in the dark here, I'm not a programmer, I used to learn C++, later a bit of VBA, but that was 10+ years ago. Also I don't have a debugger here, so I can't even test the content of the variables.


2.The other problem is saving the files to our network drive. I installed the gateway, then I was trying to use the "File System" connector. At first I tried saving the files to my local HDD, but even though I correctly specified my username credentials, password and gateway name I get an error message: "Cannot create connection for the connection Identifier ...". I have no idea why, I asked our IT guy, but he's not familiar power apps. He is the admin of our Office 365, is there a setting somewhere that maybe disables this functionality? I checked the gateway, I ran the connection test, it showed that I was connected.


Can anyone help me out? If not, then I'll just try to crack this on own and probably spend a few more days on it, but I thought that it might be a lot less painful if I just asked here.


Accepted Solutions
Frequent Visitor

Hello, point 1 is no longer valid. Just spent 30 minutes reading and I finally used the function string() in the date variable, them for var 3 i used the function concat(variables('Data'),variables('Temat')).


I still have a problem with point 2 though..

Frequent Visitor


I'm subscribed to these:

Microsoft 365 Business Standard
Power Virtual Agents for Office 365
Common Data Service for Teams
Project for Office (Plan E3)
Common Data Service
Whiteboard (Plan 1)
Insights by MyAnalytics
RETIRED - Microsoft Invoicing
Microsoft Kaizala Pro
Stream for Office 365
Microsoft StaffHub
To-Do (Plan 1)
Microsoft Bookings
Microsoft Forms (Plan E1)
Flow for Office 365
PowerApps for Office 365
RETIRED - Outlook Customer Manager
Microsoft Teams
Microsoft Planner
Office for the web
Najnowsza wersja klasyczna pakietu Office
Yammer Enterprise
Exchange Online (Plan 1)
Skype for Business Online (Plan 2)
SharePoint (Plan 1)
Microsoft Power Automate Free
Common Data Service
Flow Free
So, just so I can confirm to my IT Fellow, the on-premises gateway will not run without an additional plan, we have to subscribe to the Per user plan at least (for 15$ per user) to get it working?
Resolver II
Resolver II

That is possible. I am lucky, where I work IT has all of this licensing stuff taken care of and it is transparent to me.


Here is a link I found to the pricing.


You need to hold your IT's feet to the fire and have them understand the infrastructure requirements. You use the tools they, own the toolshed.


Sorry wish I could be more help.

Frequent Visitor

Actually, You did help me as my question was answered. So thanks 🙂 Now I just need to talk our IT guy, if he has a tool to sync between onedrive and our network drives, can we buy other software that can do that (for example AOMEI Backupper), or we just subscribe to a Power Automate plan.

Helpful resources

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 (1,818)