cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
msarfaraz
Level: Powered On

Attachment File Copy to One Drive Business when Specific Subject Meet

I am receiving the reports daily  from email address ABC@abc.com and looking the specific subject which is "Date Last Updated: 2018-04-16" the subject daily changed by date for example tommorow it will be "Date Last Updated: 2018-04-16", how i can set the flow that daily this attachement will copy in One Drive Business and replace old file.

6 REPLIES 6
Super User
Super User

Re: Attachment File Copy to One Drive Business when Specific Subject Meet

Hi @msarfaraz,

 

The easiest way is to create flow that will be triggered when new email arrives to your mailbox.

 

There is option to set Subject Filter for this trigger, there can be placed something like: "Date Last Updated:".

Next step there should be condition for subject verification and this subject should contain the current date like in formula below:

 

formatDateTime(utcNow(), 'yyyy-MM-dd')

In this case utcnow() represents current day and formatdatetime() is formatting it to specific format you have in Subject.

If this this condition is met, than you should store attachment by "Create file" on OneDrive for Business. and as File content use attachment, if there is need to rename previous file, then use FileName.

 

Hope this helped you.

P.

 

 

 

 

Highlighted
Community Support Team
Community Support Team

Re: Attachment File Copy to One Drive Business when Specific Subject Meet

Hi @msarfaraz,

 

Do you want to copy attachment files to OneDrive for Business folder based on the specific Subject of the received email?

 

I agree with @vecerpa's thought almost. I have made a test on my side and please take a try with the following workaround:

  • Add a "When a new email arrives" trigger, Has Attachment field and Include Attachments field both set to Yes.
  • Add a Condition, left input box set to Subject dynamic content of the trigger, right input box set to following formula:
concat('Date Last Updated: ', formatDateTime(utcNow(), 'yyyy-MM-dd'))

Within middle drop down, choose is equal to.

 

or you could also click "Edit in advanced mode", type the following formula:

@equals(triggerBody()?['Subject'], concat('Date Last Updated: ', formatDateTime(utcNow(), 'yyyy-MM-dd')))

 

  • Within "If/yes" branch of Condition, add a "Apply to each" action, input parameter set to Attachments dynamic content of the trigger.

         Within "Apply to each" action, add a "Create file" action of OneDrive for Business connector, specify Folder Path, File Name set to Name dynamic content of the trigger, File Content field set to Content dynamic content of the trigger.

 

Note: If the Dynamic contents would not be shown up automatically, please click the "See more" button within right Dynamic content panel.

 

Image reference:3.JPG

 

4.JPG

The flow works successfully as below:5.JPG

 

More details about using expression in flow actions, please check the following article:

Use expression in flow actions

 

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
msarfaraz
Level: Powered On

Re: Attachment File Copy to One Drive Business when Specific Subject Meet

Hi Kris 

 

The subject line is as below

 

IDeaS Reporting - Multi-Property - Date Last Updated: 2018-04-17 : Madinah Data Extraction Program Daily

 

Daily basis the dates get change i.e. tommorow the subject line will be

 

IDeaS Reporting - Multi-Property - Date Last Updated: 2018-04-18 : Madinah Data Extraction Program Daily

and so on, so what will be the formula 

Community Support Team
Community Support Team

Re: Attachment File Copy to One Drive Business when Specific Subject Meet

Hi @msarfaraz,

 

Within the Condition box of the flow I provided, change the formula as below:

 

Left input box set to Subject dynamic content of the trigger, Right input box set to following formula:

concat('Date Last Updated: ', formatDateTime(utcNow(), 'yyyy-MM-dd'))

Within middle drop down, choose contains.

 

Or click "Edit in advanced mode", type the following formula:

@contains(triggerBody()?['Subject'], concat('Date Last Updated: ', formatDateTime(utcNow(), 'yyyy-MM-dd')))

Image reference:11.JPG

 

12.JPG

 

 

Best regards,

kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
msarfaraz
Level: Powered On

Re: Attachment File Copy to One Drive Business when Specific Subject Meet

flow test.jpgflow.jpg

msarfaraz
Level: Powered On

Re: Attachment File Copy to One Drive Business when Specific Subject Meet

I dont know where am wrong, but it failed.

Helpful resources

Announcements
firstImage

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

firstImage

Incoming: New and improved badges!

Look out for new contribution recognition badges coming SOON!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Users online (3,973)