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

Get Original Email from Fowarded using Sharepoint List lookup Create Folder/File

Hi,

 

I've created a workflow that gets the original email sender from a forwarded shared mailbox and then saves the attachment by looking up a list in Sharepoint for the user/folder references. The issue is that the workflow looks successful, but the CreateFolder/CreateFile are greyed out and I can't seem to see where it's failing. Any thoughts are appreciated.

 

stvn43_0-1668704546781.png

This is the first segment that extracts the original sender email. The condition is just a 'Sent' > 'From', which passes 'true' for a forwarded email.

stvn43_0-1668705553472.jpeg

 

This is the second branch that uses the Sharepoint list to lookup the original email, compare it and get the Folder to know where to save the attachment. This is accounting so it uses the CurrentYear/CurrentMonth functions for the initial creation of the folders.

I have a slight variation on this that is just for inbound emails on the shared mailbox that works well.

 

The only change from the original is that I'm now having to get the original email from the forwarded one. Yet, it runs and doesn't save the attachment and moreover, I can't see anything in these last to steps as they're greyed out.

Any suggestions welcome -- thx!

 

Sorry -- a more detailed view:

 

stvn43_1-1668706747247.jpegstvn43_2-1668706788542.png

 

stvn43_4-1668706847202.jpeg

 

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
annetoal
Super User
Super User

Nothing satisfied your filter query in Get items. Re-check your filter query to make sure it's doing what you want. You have a comparison between the query and a variable. Maybe the variable is at fault.

View solution in original post

stvn43
Frequent Visitor

Correct -- annetoal -- thx!

 

I modified this section so it pulls the email accurately and updates the variable appropriately for the Sharepoint list match. 

 

trim(substring(body('EmailBodyToText')
,add(indexOf(body('EmailBodyToText'),'From: '),6)
,sub(indexOf(body('EmailBodyToText'),'Sent:')
,add(indexOf(body('EmailBodyToText'),'From:'),6)
)))


trim(substring(last(split(outputs('ExtractEmail'),'<'))
,0
,sub(length(last(split(outputs('ExtractEmail'),'<'))),1)
))

View solution in original post

2 REPLIES 2
annetoal
Super User
Super User

Nothing satisfied your filter query in Get items. Re-check your filter query to make sure it's doing what you want. You have a comparison between the query and a variable. Maybe the variable is at fault.

stvn43
Frequent Visitor

Correct -- annetoal -- thx!

 

I modified this section so it pulls the email accurately and updates the variable appropriately for the Sharepoint list match. 

 

trim(substring(body('EmailBodyToText')
,add(indexOf(body('EmailBodyToText'),'From: '),6)
,sub(indexOf(body('EmailBodyToText'),'Sent:')
,add(indexOf(body('EmailBodyToText'),'From:'),6)
)))


trim(substring(last(split(outputs('ExtractEmail'),'<'))
,0
,sub(length(last(split(outputs('ExtractEmail'),'<'))),1)
))

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.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,323)