cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
eric-rdi
New Member

Extract domain name from attachment sender ->create folder for save of attachment

Hello,

I've found flows to save attachments from emails and changed it to save in a folder from the email sender. I'd like to change it to save attachments from the sender into a folder from their domain.  I.E.  john@doe.com and jill@doe.com sending attachements would all be saved into doe.com folder.

 

UPDATE: So this is probably basic for most of you, but I'm a noob so for all the other noobs out there: the expresion I used was  

 
last(split(variables('From'),'@'))

Capture.JPG

 

 

 

 

Any help would be appreciated!

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
v-yuazh-msft
Community Support
Community Support

Hi @eric-rdi,

 

Could you please share more details about you problem when you create the flow to acheive your requirement?

 

I think your flow would works if you want to save attachments from received email in a new folder (email sender domain name).

 

And you could also create the flow as below:

Capture.PNG

 

 

Please let me know if your problem could be solved.

 

Best regards,

Alice

View solution in original post

3 REPLIES 3
v-yuazh-msft
Community Support
Community Support

Hi @eric-rdi,

 

Could you please share more details about you problem when you create the flow to acheive your requirement?

 

I think your flow would works if you want to save attachments from received email in a new folder (email sender domain name).

 

And you could also create the flow as below:

Capture.PNG

 

 

Please let me know if your problem could be solved.

 

Best regards,

Alice

Thanks for the reply!

 

I got it figured out - I was looking for left and right and found last and first.

 

I ended up using  last(split(variables('From'),'@'))  and expanded that to sort into a folder for domain and another subfolder for sender  first(split(variables('From'),'@')) 

 

Cheers!

YoDaDude
New Member

Hello:

 

This is helpful - thank you.

However, am uncertain how I can combine the last response by the original poster into an expression i can use into the 'fx/ expression' box to obtain the result of moving the attachments to Root/Email Attachments/Domain.Com/Sender/

 

1. I cant just enter last(split(triggerBody()?['From'],'@'))/first(split(triggerBody()?['From'],'@'))

2. I dont want this directory structure created in the Root (As is the default) - but in a directory called 'Email Attachments'

Could you please help.

 

Thank you!

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Users online (2,952)