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:
  • 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,331 Most Valuable Professional on at

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 389

#2
11manish Profile Picture

11manish 345 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 308

Last 30 days Overall leaderboard