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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / I can't understand an ...
Power Automate
Unanswered

I can't understand an error in Date field in a SharePoint List, condition work different as expected

(1) ShareShare
ReportReport
Posted on by 8

Hi,

someone can help me to understand what it's going different on managing a date from email body when I try to store it in a SharePoint list field?

 

I have to retrive information from an email

between various data to retrive I have also 2 field date ... these fields in some email are present ...

 

Screenshot 2024-07-03 170327.png

 

... in some else they aren't

 

Screenshot 2024-07-03 170130.png

 

 so, I try to manage presence or not of the information with a if condition:

if(equals(first(skip(split(first(split(body('Da_HTML_a_testo_-_corpo-email'),'To:')),'From: '),1)),null),null,replace(first(skip(split(first(split(body('Da_HTML_a_testo_-_corpo-email'),'To:')),'From: '),1)),decodeUriComponent('%0A'),''))

 

but, when the field isn't present in the email body I obtain an error:

OpenApiOperationParameterTypeConversionFailed
The 'inputs.parameters' of workflow operation 'Crea_elemento_-_landing-page' of type 'OpenApiConnection' is not valid. Error details: Input parameter 'item/DateTo' is required to be of type 'String/date'. The runtime value '""' to be converted doesn't have the expected format 'String/date'.

 

... and in the execution plan I can see that as result of the expression i obtain an empty string

Screenshot 2024-07-03 164913.png

 

 

 

... so I also try using expression null in a filed and if condition in other

Screenshot 2024-07-03 165526.png

 

Screenshot 2024-07-03 165602.png

 

 

 

and with the expression null I get the result I expect null value in the field and no error (the error in the screenshot is for the second date field, with if condition)

Screenshot 2024-07-03 165322.png

 finally I verify if condition "equals(first(skip(split(first(split(body('Da_HTML_a_testo_-_corpo-email'),'To:')),'From: '),1)),null)" and it's true than I undestand that expression have to return null as the same of expression null without if condition

 

Any help will be great

Thank you

 

 

 

Categories:
I have the same question (0)
  • annajhaveri Profile Picture
    8,531 Most Valuable Professional on at

    @acuf  i am not sure if i understand your issue, if you provide date value as null in action that works, right? So which condition are you facing the issue with?

  • acuf Profile Picture
    8 on at

    @annajhaveri thank'you for you answer, I'll try to explain better my issue

     

    if I use a simple null expression in date field it's work fine ...

    Screenshot 2024-07-03 165602.pngScreenshot 2024-07-03 165322.png

    ... but I need to manage properly the presence of the date in email body, when I use a condition I expect to obtain same result but I obtain a empty string and not a null field, and the flow generate a error

    Screenshot 2024-07-08 121252.pngScreenshot 2024-07-03 164913.png

     

    condition is true, so I expect that PA execute istruction in red:

    if(equals(first(skip(split(first(split(body('Da_HTML_a_testo_-_corpo-email'),'To:')),'From: '),1)),null),null,replace(first(skip(split(first(split(body('Da_HTML_a_testo_-_corpo-email'),'To:')),'From: '),1)),decodeUriComponent('%0A'),''))

     

    I don't understand why I obtain a different result

  • annajhaveri Profile Picture
    8,531 Most Valuable Professional on at

    @acuf  okay so you mean that the if expression you are using in the date field, is not returning null, right?

  • acuf Profile Picture
    8 on at

    Right

  • acuf Profile Picture
    8 on at

    @annajhaveri any suggestion?

  • ScottShearer Profile Picture
    25,290 Most Valuable Professional on at

    @acuf 

    Try using a coalesce() expression

    Power Automate Coalesce Function Explained (zeitgeistcode.com)

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 250 Super User 2026 Season 1

#2
Expiscornovus Profile Picture

Expiscornovus 222 Most Valuable Professional

#3
Haque Profile Picture

Haque 174

Last 30 days Overall leaderboard