Turning days in a data table to date formats automatically

Hello Uipath experts,

I want to know if it is possible to turn the days in the data table above into date formats automatically. These timetables are generally used on a weekly basis so I figured I could do something with the current date and then add an amount of days to it based on the given day. However, I couldn’t get it to work properly…

Hi @rpaengineer
I guess there are many ways to do it, for example if your report is generated always on Mondays, you use date.Now as your DateTime variable (e.g. called “today”), then you can put your Days of Week read from the data table as a String variable (e.g. called “weekDay”) and then you can use Flow Switch where you would create 7 different scenarios (e.g. to get Tuesday’s date you would apply today.AddDays(1).ToString(“dd/MM/yyyy”), to get Wednesday’s date you would apply today.AddDays(2).ToString(“dd/MM/yyyy”) etc.)
Does this solve your issue? :slight_smile:

Instead of a today’s date, if your work is based on some file generated always on the same date, you can use its creation date as a DateTime variable: assign today = new FileInfo(“here place the file path”).CreationTime .

Otherwise you may play with the advice from this thread:

Does this all help you a bit?

Hi @PAD,

Thanks a lot for your answers. Your idea with the 7 different scenarios also crossed my mind, but I didn’t know how to make that correctly. The screenshot is very helpful. I will try to implement this.

No problem, let me know if that works for you in practice. Happy New Year!