Fabs
(FP)
January 12, 2024, 10:42pm
1
Hi All,
Every day I run a process to look for specific emails and download the attachments for the current day. However, I want to set a condition that it only creates a folder for them to be saved if there was an attachment to download.
Is anyone able to assist?
One folder for all downloaded attachments
vrdabberu
(Varunraj Dabberu)
January 13, 2024, 3:53pm
2
Hi @Fabs
you can replicate the flow as per below. It should help you.
In the set variable value give the below syntax:
folderPath= Path.Combine("C:\YourBaseFolder", "Attachments", DateTime.Now.ToString("yyyy-MM-dd"))
Change the path according to yours.
Regards
Fabs
(FP)
January 19, 2024, 8:23pm
3
Update: There will always be a report but I only need to create a folder for a particular day, so I was able to resolve as the following:
If(DateTime.Now.DayOfWeek = DayOfWeek.Friday, “YourBaseFolder” & DateTime.Now.AddDays(-1).ToString(“ddMMyyyy”), “”)
In this example, if today is Friday it creates the folder with yesterday’s date (as required) and it saves the attachments to the create folder.
What I need now is that if today isn’t Friday, to do nothing. The current error I get is:
If(DateTime.Now.DayOfWeek = DayOfWeek.Monday, “YourBaseFolder” & DateTime.Now.AddDays(-1).ToString(“ddMMyyyy”), “”)
Are you able to help?
Fabs
(FP)
January 19, 2024, 8:48pm
4
If(DateTime.Now.DayOfWeek = DayOfWeek.Friday, “YourBaseFolder” & DateTime.Now.AddDays(-1).ToString(“ddMMyyyy”), “Nothing”)
system
(system)
Closed
January 22, 2024, 8:49pm
5
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.