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.
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.
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:
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 "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:
The flow works successfully as below:
More details about using expression in flow actions, please check the following article:
Use expression in flow actions
Best regards,
Kris
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
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:
Best regards,
kris
I dont know where am wrong, but it failed.
User | Count |
---|---|
16 | |
16 | |
14 | |
9 | |
8 |
User | Count |
---|---|
28 | |
26 | |
24 | |
23 | |
14 |