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 / store null/blank value...
Power Automate
Unanswered

store null/blank value into a Date column of a SharePoint list using power automate flow.

(1) ShareShare
ReportReport
Posted on by 84
Hello Everyone, 
 
I am importing date values from the excel table and there is the possibility some dates are empty/null/blank. 
I have created flow and it works fine with other fields but when it comes to date it is giving me following error:
InvalidTemplate. Unable to process template language expressions in action 'Update_item' inputs at line '0' and column '0': 'The template language function 'item' must not have any parameters.'.
 
I have tried following the formulas but am still not able to figure out how to achieve the result. 
 

addDays('1899-12-30',int(items('Apply_to_each')?['DOB']),'yyyy-MM-dd')

addDays('1899-12-30',int(items('Apply_to_each')?['DOB']),'yyyy-MM-dd')

if(equals(item()?['DOB'], null), '', formatDateTime(item()?['DOB'],'yyyy-MM-dd'))

if(equals(item('Apply_to_each')?['DOB'], ''), null, addDays('1899-12-30', int(item()?['DOB']), 'mm/dd/yyyy'))

if(empty(replace(item()['DOB']),'"','')),null,addDays('1899-12-30',int(replace(item()['DOB']),'"','')),'MM/dd/yyyy'))

 

In excel and SharePoint list, the name of the field DOB and it is created with default parameters. 

 

tusharmehta_0-1643287082068.png

 

tusharmehta_1-1643287153628.png

 

In excel date format is mentioned below:

 

tusharmehta_2-1643287275460.png
tusharmehta_3-1643287329306.png

 

Steps by Step will be highly appreciated. 

 

Thanks in advance. 

 

Tushar Mehta

 

 

 

Categories:
I have the same question (0)
  • v-JessicaG-msft Profile Picture
    on at

    Hi @tusharmehta ,

     

    You could check if the excel date column is a blank value. Add empty value in SharePoint field if excel date column is empty.

     

    vJessicaGmsft_1-1643620504073.png

     

    Best Regards,

    Jessica Gu

     

  • tusharmehta Profile Picture
    84 on at

    Thanks for the information, 

     

    I have a minimum of 4 dates in single records and I believe all those will be difficult to check with individual conditions. 

     

    What I have understood from your reply that when we are passing blank value to SharePoint list it is throwing the error correct ?

  • nscates Profile Picture
    18 on at

    Does anyone have any input on this? I have a similar situation where I'm trying to import an Excel table into a new SharePoint list, but the workflow fails when it hits empty date fields in the table. I tried building a condition into the apply to each node, as pictured above, but I can't seem to get the expression right, the workflow fails to properly identify the blank fields and crashes before completing. 

    I have considered placing a false 1901 date in all of the fields that do not have one, but that seems like a clumsy workaround - can anybody provide an approach that will allow any blank field in the excel sheet to properly import as a blank/null field in the SharePoint list? Many, many thanks in advance!!!

  • USNHAuto Profile Picture
    20 on at

    Hello all,

    I had a similar situation but I am getting data from power apps and the date input is blank

    What I did is this: (in SharePoint Create Item)

    if( less ( length ( item()['Date'] ) ,1 ) , null, item()['Date'] )
     
    I hope it helps anyone looking for this in the future!
  • nscates Profile Picture
    18 on at

    Thanks USNHAuto, that expression did the trick!

  • crisdiglesias Profile Picture
    22 on at

    Hello @USNHAuto, thank you for your solution.

    I would like to make an observation about something that caused me to lose quite a bit of time until I understood what was happening. I have been using the new Power Automate designer routinely due to its aesthetics and fluidity. That said, when applying your solution, my flow consistently displayed the same error message mentioned by @tusharmehta. After several hours of not understanding what was going on, I decided to revert to the old Power Automate designer and test the flow again. Surprisingly, it didn’t show any errors. Once I realized that the initial error was related to the new designer, I returned to it and tested again. To my surprise, the flow completed successfully without the initial error message.

    I hope this account of my experience is useful in some way. Regards!

     

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 503 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 321 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard