cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Thomas
Level 8

Excel Date without a year is NULL

Hello,

 

I´ve got a birthday reminder flow.

An Excel-Sheet contains names and dates. Some of them are containing a year, some just day & month:

 

Thomas 13.06.

Peter      15.08.1985

 

In the past, it hung something like 1901 or 1902 behind it (It seemed to be raising every year...).

It was easy to check:

lessOrequals(int(formatdatetime(item()?['Birthday'],'yyyy')), 1910)
and
startsWith(items('Repeat_with_all')?['Birthday'], formatdatetime(utcnow(), 'dd.MM.'))
Since some time (I don´t know exactly, because it just hasn´t notify me),

the Flow interprets the dates without a year as "null"!

 

Changing the dates in Excel to text works, but this has two big problems:

  1. New created lines automatically become a date
  2. Old lines with a year become an unreadable integer

 

In my opinion, this is a bug!

1 ACCEPTED SOLUTION

Accepted Solutions
Thomas
Level 8

Re: Excel Date without a year is NULL

Allways a pity, when things worked in the past and now they act different/wrong.

But due to the fact nothing changed, I created my own workaround:

 

My dates without a year now contain 1900 as a placeholder.

It was some manual work to add the year and now every new entry has to be made with a year, but it works and seems to be the easiest/laziest solution.

 

Conclusion:

Fetching a date without a year (formatted as a date) will be returned as null.

View solution in original post

5 REPLIES 5
Community Support Team
Community Support Team

Re: Excel Date without a year is NULL

Hi @Thomas,

 

Do you want to get a birthday reminder using Microsoft Flow?

 

Thanks for your feedback, I have created a Birthday excel sheet as below:21.JPG

 

If you want to get birthday reminder using Microsoft Flow, I think it is not necessary to check the year, we only need to check if the day & month of today is equal to the day & month of people's birthday.

 

I have made a test on my side, please consider take a try with the following workaround:

  • Add a "Recurrence" trigger, Interval set to 1 and Frequency set to Day.
  • Add a "Get rows" action, specify File Name and Table Name.
  • Add a "Apply to each", input parameter set to output of "Get rows" action.
  • Within "Apply to each" action, add a Condition, click "Edit in advanced mode", type the following formula:
@startswith(items('Apply_to_each')?['Birthday'], formatDateTime(utcNow(), 'dd.MM.'))

Within "If/yes" branch of Condition, add a "Send an email" action.

 

Image reference:22.JPG

The flow works successfully as below:23.JPG

 

24.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.
Thomas
Level 8

Re: Excel Date without a year is NULL

Hello Kris @v-xida-msft,

 

thanks a lot for your reply!

This is exactly what I´m doing.

 

But in my case "09.02." gives me null and raises an error. Any date with a year works.

Date is Null.png

What kind of datatype in Exel do your birthdays have?

 

My findings:

Using text in Excel as datatype works. Using date only works with a year (but it worked some time ago).

Changing all my dates to text converts them into integer -> not suitable. 13.06.1984 becomes 31576

Creating new entries auto-formats them into date again.

 

Thomas

Thomas
Level 8

Re: Excel Date without a year is NULL

It still does not work.

And it´s worse 😞

 

Even checking for null does not work. Not by equals, nor by empty:

if(empty(item()?['Birthday']), ' - ', sub(int(formatdatetime(utcnow(),'yyyy')), int(formatdatetime(item()?['Birthday'],'yyyy'))))

Still failing with:

 
InvalidTemplate. Unable to process template language expressions in action 'Verfassen' inputs at line '1' and column '2247': 'The template language function 'formatdatetime' expects its first parameter to be of type string. The provided value is of type 'Null'. Please see https://aka.ms/logicexpressions#formatdatetime for usage details.'.
 
This breaks my current workaround, to have one clumn with the date (including or excluding a year "Birthday") and "BirthdayText" only having the day and month, formatted as text in Excel.
 
@v-xida-msftwould you betray which format you are using in your date-column?
 
Thomas
Thomas
Level 8

Re: Excel Date without a year is NULL

Allways a pity, when things worked in the past and now they act different/wrong.

But due to the fact nothing changed, I created my own workaround:

 

My dates without a year now contain 1900 as a placeholder.

It was some manual work to add the year and now every new entry has to be made with a year, but it works and seems to be the easiest/laziest solution.

 

Conclusion:

Fetching a date without a year (formatted as a date) will be returned as null.

View solution in original post

Thomas
Level 8

Re: Excel Date without a year is NULL

I had to revise my conclusion...

 

Today I got a mail notification about Person 2´s birthday which is tomorrow.

Excel-Entries:

Person 1 24.02.1989

Person 2 23.02.1900

Person 3 28.02.1900

 

I expect it to be a timeshift between UTC and Europe or somehing. So I composed a variable:

@formatdatetime(item()?['Birthday'], 'dd.MM.') - @formatdatetime(utcnow(), 'dd.MM.')

Which gives me that in flow history:

24.02. - 22.02.

23.02. - 22.02.

28.02. - 22.02.

 

Fine!

My condition is using the same values:

@equals(formatdatetime(item()?['Birthday'], 'dd.MM.'), formatdatetime(utcnow(), 'dd.MM.'))

But the condition was true! How can that be???

 

So I went on and append the birthdate and current date behind my age calculation, within my email:

 

Todays birthdays:

  • Person 2 ( - ) 22.02. - 22.02.

It is very, very unrelyable! The historic data, shows different values to what was processed!

Processing is wrong, and the data, stored in executed flows is not real!


 

Hour after hour of lost time, trying to fix what already worked for month. Again and again 😞

 

Update:

It is related to my year 1900 workaround. If I change the date to 23.02.1980, it works.

Something is really messed up with that connector Smiley Frustrated

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!

Top Solution Authors
Users online (5,111)