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

Community site session details

Session Id : tP9xxeQBf/Lak4I3IHlfuF
Power Automate - Using Flows
Answered

If expression for date failing

Like (0) ShareShare
ReportReport
Posted on 5 Jan 2023 19:31:18 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
    19 on 05 Jan 2023 at 20:24:50
    Re: If expression for date failing

    That worked! Thank you!

  • Verified answer
    Sundeep_Malik Profile Picture
    6,482 on 05 Jan 2023 at 20:08:24
    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

Announcing our 2025 Season 2 Super Users!

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 2

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 2

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 2

Featured topics

Restore a deleted flow
Loading complete