Skip to main content

Notifications

Power Automate - Using Flows
Answered

If expression for date failing

(0) ShareShare
ReportReport
Posted on by 19

I am running the following flow to create items in SharePoint list from Excel files and I am receiving an error on the If expression I am using for the Date Returned column. I added the expression because I received an error for having no dates in some items.

 

The other date columns are pulling in as expected, but they all contain a date so no If expression was needed. I do have the DateTime format set to ISO 8601.

 

Is there something else I need to add to the IF statement? 

if(equals(item()?['Date Returned'],''),null,item()?['Date Returned'])

 

CRMCS_3-1672946302541.png

 

 

CRMCS_7-1672946920090.png

 

Error Message:

CRMCS_4-1672946517997.png

 

 

 

  • CRMCS Profile Picture
    CRMCS 19 on at
    Re: If expression for date failing

    That worked! Thank you!

  • Verified answer
    Sundeep_Malik Profile Picture
    Sundeep_Malik 6,480 on at
    Re: If expression for date failing

    Hey @CRMCS 

     

    Use the following expression it might help:

     

    if(empty(item()?['Date Returned']),null,addDays('1899-12-30',int(item()?['Date Returned']),'yyyy-MM-dd'))

     

    Link for Handling Excel Dates in Power Automate:

     

    https://www.shanebart.com/ms-flow-excel-dates/

     

    I hope this helps 🙂

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,434

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,722

Leaderboard

Featured topics

Restore a deleted flow