cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Advocate I
Advocate I

Updating a CDS date field that could be blank

Hi folks,

Is there an easy way when updating a CDS record to cope with a possibly blank date field? I've tried all kinds of logic to check for a null/blank date but I get this error when the Flow runs: 

 

  "message": "DateTime is less than minumum value supported by CrmDateTime. Actual value: 01/01/0001 00:00:00, Minimum value supported: 01/01/1753 00:00:00",

 

The screenshot below shows an expression for the date field but even if that expression results in null or blank it still tries to update the date field with that value. 

 
dateupdate.png
 
The only way I've found that works is to check for the blank date in a condition and then have identical update actions on the yes/no of the condition either with a date or without (so if the date is non-blank it would look like the above screenshot, if it's blank it would look like the screenshot below). 

dateupdate2.png
 
Thank you,

Matt
 
11 REPLIES 11
Community Support
Community Support

Hi @MattTaylor,

 

You could try to use the expression into the Milestone Date field:

if(equals(empty('value'),true),'','value')

The value is the possibly blank date field, the result of the expression is if the value equals to empty, the result of the expression will be blank, or the result will be value.

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks for replying.

I've already tried this and unfortunately even '' as a value causes an error with a date field (I'll double check to ensure I'm correct). It looks like it tries to update the field with '' rather than just not updating. 

Hi @MattTaylor,

 

Yes, if there will have an expression in action, it will attend to append it:

How about using the null to append it:

if(equals(empty('value'),true),null,'value')

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Hi @v-litu-msft,

I've tried this as well, it does the same thing unfortunately. 

Hi Matt

 

Did you find a solution to this. I have exactly the same problem.

 

Steven

I'm having the same issue.  I would love to find a solution for this.

Hi @marchantrr ,

 

Just update the date field with null (using expression) and it works for me.

 

Thanks

@ManishJain

 

Could you post a screenshot of your solution - I have tried setting the value to null and that produces the error (in fact on reading around this, that error is shown when you try and set a date field to null). 


Cheers,


Matt

Hi all I found out, after a long back-and-forth with MS tech support that it works in "Update a CDS record (current environment)" but not "update a CDS record". There are 2 available actions when picking.  Unfortunately "update a CDS record (current environment)" seems to introduce other hurdles.

 

 

I don't see the Update a CDS record (current environment) action.

 

marchantrr_0-1592709117512.png

I still haven't been able to get this to work.

Hi @marchantrr. I remembered that this is only available for flows inside a solution:

Stevenfayers_0-1592727990159.png

 

If memory serves me correctly (and if MS haven't fixed it) you might also find it won't work for flows imported into a solution.

The (current environment) updates are a pain in the $%&@.  Things like this: https://crmtipoftheday.com/1311/use-entity-name-in-flow-lookups/. I would test the whole thing first before deciding to move to CDS (current environment).

 

 

Helpful resources

Announcements
Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Users online (29,249)