web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Power Automate thinks ...
Power Automate
Unanswered

Power Automate thinks a date is null, but it isn't?

(0) ShareShare
ReportReport
Posted on by 299 Moderator
Hello, 
 
I have a Sharepoint list, with 2 Excel spreadsheets, both have their own table. 
 
I need to upload data into a Dataverse table, the column that gives me trouble is date only.
 
My first flow seemed to work (after many attempts) with this format date
 
@{if(empty(items('Apply_to_each')?['abcd_dateofbirth']), '1900-01-01', concat(substring(items('Apply_to_each')?['abcd_dateofbirth'], 6, 4), '-', substring(items('Apply_to_each')?['abcd_dateofbirth'], 3, 2), '-', substring(items('Apply_to_each')?['abcd_dateofbirth'], 0, 2)))}
 
Today doesn't seem to work, it hard codes 01/01/1900 
 
I am trying to recreate the success from yesterday for my other flow, but it keeps giving me all sorts of errors on how it doesn't accept the date
 
InvalidTemplate. Unable to process template language expressions in action 'Compose_2' inputs at line '0' and column '0': '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.'.
 
 
These are my flow steps
 
1. Manually Trigger a flow
2. List rows present in a table
3.Apply to each
List rows for Customers table
Filter rows: abcd_uniquevulnerableid eq '@{items('Apply_to_each')?['Member ID']}' and abcd_dynamicuniquememberid eq '@{items('Apply_to_each')?['Unique ID']}'  - it is in this step that the output 'reads' the value correctly
4. Compose
@{formatDateTime(items('Apply_to_each')?['abcd_daterecordsadded'], 'yyyy-MM-dd')} - by the time I reach this step, it throws errors in why date is incorrect
5. Apply to each @{outputs('List_rows')?['body/value']}
Add a new row in Vulnerabilities Recorded
Specify in the row formatted date
abcd_customerses(@{items('Apply_to_each_2')?['abcd_customersid']})
abcd_customerses(@{items('Apply_to_each_2')?['abcd_customersid']})
@{outputs('Compose_2')}
 
My question is, why does Power Automate think Excel has no values, when there are clearly values, it just seems it forgets after a few steps? 
 
I've been battling date issues for days, I would appreciate some guidance and perhaps a thorough 'how to' 
 
What I am doing is open the file, compare the unique IDs to the dataverse record, if the ID matches, then add several records that belong to the customer, in the RecordsAdded table, I wonder if this '2 tables' is confusing Power Automate
 
Categories:
I have the same question (0)
  • Verified answer
    inanoffice23 Profile Picture
    299 Moderator on at
    My Dev colleague managed to figure out, needed a 'Compose' and then edited the serial number with decimal dates
     
    formatDateTime(adddays('1899-12-30',int(split(item()?['Date Record Added'],'.')[0])),'yyyy-MM-dd')
     
     
     
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard