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 / Updating Sharepoint da...
Power Automate
Unanswered

Updating Sharepoint date field to null returning errors

(0) ShareShare
ReportReport
Posted on by 11

This is so strange. I have a long-running flow in Prod that has a simple expression to update a date field on a SP list and it works.

 

if(
    equals(items('Apply_to_each_-_Outcome')?['ArtifactStatus']?['Value'],'In Review'),
    utcNow(),
    ''
)

 

cwarshaw_0-1697778645742.png

 

I do the same exact thing on another flow and it fails...

 

cwarshaw_1-1697778862732.png

 

Error Text: The runtime value '""' to be converted doesn't have the expected format 'String/date'.

 

I don't know why it isn't like the null value in this context. I've looked at other threads and they suggest the same formula, I've tried passing in null variables, and all sorts off different things. As best I can tell it seems like it thinks it is undefined instead of null, but I have no idea why it would do that even when I hardcode in null.

 

Categories:
I have the same question (0)
  • ManishSolanki Profile Picture
    15,091 Super User 2025 Season 2 on at

    Hi @cwarshaw 

     

    Pls try the below expression:

    if(
        equals(items('Apply_to_each_-_Outcome')?['ArtifactStatus']?['Value'],'In Review'),
        utcNow(),
        null
    )
     
    If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.
     
    Thanks
  • cwarshaw Profile Picture
    11 on at

    Ya I've tried that as well. No luck... I've messed around with all sorts of permutations of null and ''. I've tried just leaving a variable blank and putting that in. All the same error.

  • Verified answer
    cwarshaw Profile Picture
    11 on at

    So for anyone curious it was the difference between "Update Item" and "Update Item"... Now you might be saying to yourself "those are the same thing..." and you'd be right! But as you can see the code on the raw inputs is slightly different. "Method: Patch" vs "OperationID: Patch Item" if I copy and past my old action into my new flow it works. But anytime you try to create a new action it's going to use the new code which does not...

     

    To me this seems like a pretty opaque bug that they should address. Especially because any new actions are affected. For now I'm going to use the workaround, but this was a waste of a day.

  • CARTERA_1 Profile Picture
    20 on at

    Do we have any update from Microsoft on a fix for this as it seems to be a glaring problem and is currently preventing one of our new flows being developed / published as we need to reset a date field to blank. Unfortunately we do not have another flow with the OLD patch method, so are limited by the NEW one

  • JohnNovember Profile Picture
    11 on at

    Depending on which designer you're using, may not be an issue with your code:

    https://www.youtube.com/watch?v=7I4b2vgG8y8 

  • CARTERA_1 Profile Picture
    20 on at

    Many thanks for your reply I think I fixed my issue, or it started working with the NULL value

  • bcobra42 Profile Picture
    26 on at

    This is still broken for me:

    if(empty(outputs('Compose_Date')), if(empty(first(body('Get_items_Product')['value'])?['GroupDate']),null,first(body('Get_items_Product')['value'])?['GroupDate']), outputs('Compose_Date'))
     
    null is returned as "" and errors the flow
  • CARTERA_1 Profile Picture
    20 on at

    Hi @bcobra42 - Mine seems to work with the NULL value see attached. In my flow I am using this twice as a filter condition, and to reset the date field.

     

    Filter Condition

     

    {
     "type": "If",
     "expression": {
     "and": [
     {
     "not": {
     "equals": [
     "@item()?['DateCompleted']",
     "@null"
     ]
     }
     }
     ]
     },

     

     

    Update Item - partial view of code

     

     "item/DateCompleted": "@null",
     "item/IsActive": true,
     "item/NewImport": true

     

     

    EDIT - The only other thing that I might have done was use the old Flow Designer and then saved rather than using the NEW designer.

  • bcobra42 Profile Picture
    26 on at

    I just set a text variable to @null and then replaced the null in my formula to the variable and it still gave the same error

  • MauriceJutten Profile Picture
    3 on at

    I suggest viewing This  with the theme from Jaws, and be ready to hold onto your pants.

    that actually did the trick for me ........ WTF. 

    thnx @JohnNovember  

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

#2
Tomac Profile Picture

Tomac 406 Moderator

#3
abm abm Profile Picture

abm abm 245 Most Valuable Professional

Last 30 days Overall leaderboard