I am attempting to List Rows present in a table, one of those columns is formatted as date, and based on that date I will trigger emails in X number of days.
The problem is Flow doesn't like the date column and converts it into a number. I have scoured the forums looking for a solution but there doesn't appear to be a simple one (I can understand at least).
Can you advise how I import the data retaining the date format so Flow can then understand when to send the emails?
Currently I have a work around of formatting the column as General and using text but this seems illogical.
Solved! Go to Solution.
Hello @Smudgers9
You're right! Therefore we shoud substract a couple of days inside the expression, using the sub function:
addDays('01/01/1900',sub(int(items('apply_to_each')?['Order Date']),2),'dd/MM/yyyy')
I've tested on my own and it works.
Hope it helps!
Ferran
Hello @Smudgers9
Excel stores internally the dates as sequential serial numbers starting from January 1, 1900. Therefore, you should convert this number to a date in Power Automate, and then proceed with what you want to do. Have a look at this sample:
You can use the following expression to convert an excel date column (called "Order Date"):
addDays('01/01/1900',int(items('apply_to_each')?['Order Date']),'dd/MM/yyyy')
Although I'm using 01/12/1900 as the start date, you might find that 2 days are added to your excel dates. So, use 30/12/1899 as the start date if you find this issue.
Hope it helps!
Ferran
Hi @fchopo
Yes the return date is coming back 2 days ahead of the date entered into the "Order Date" column.
It won't let me use 30/12/1899 as the date as it errors with the below.
Hello @Smudgers9
You're right! Therefore we shoud substract a couple of days inside the expression, using the sub function:
addDays('01/01/1900',sub(int(items('apply_to_each')?['Order Date']),2),'dd/MM/yyyy')
I've tested on my own and it works.
Hope it helps!
Ferran
Brilliant, yes that works and now updating but can you clarify one last thing please?
Both columns are formatted as English United Kingdom with 14/03/2020 selected as the Type (see below) but both columns give different results.
The results in Stage1 Date Sent displays in the cell as "MM/dd/yyyy" but when you enter the cell in the formula bar it shows "dd/MM/yyyy".
The add days to Stage1 Date Sent is using 'dd/MM/yyyy' too so should be correct.
And the opposite is true for Chase1 Email Sent where the cell shows "dd/MM/yyyy" but when entering the cell the formula bar shows "MM/dd/yyyy"
Hope that makes sense
So a weird workaround for this is to use dd/MMM/yyyy as the format within Flow which generates the date as 08 December 2020 for example and removes the problem between recognising US and UK dates. Not ideal but it seems to work.
If anyone has a better suggestion I would like to hear it.
One thing I didn't mention which is crucial but this is when using Excel Online via a browser. If I download and open with the local App then it formats the dates correctly. The internet seems to be littered with others having the same issues and complaints. Perhaps I have missed the solution somewhere.
Hello @Smudgers9
When working with dates in Power Automate, you should always work with ISO 8601 format (yyyy-MM-dd). On the other hand, when working with Excel Online, it is going to show the dates depending on the language in your browser, your account information (Excel Online - changing date format - Office Watch (office-watch.com)) and the SharePoint/OneDrive regional settings (Change regional settings for a site - Office Support (microsoft.com))
Hope it helps!
Ferran
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
Did you know that you could restore a deleted flow? Check out this helpful article.
Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.
User | Count |
---|---|
32 | |
32 | |
25 | |
24 | |
21 |
User | Count |
---|---|
64 | |
56 | |
44 | |
37 | |
29 |