cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
CFlorian
Frequent Visitor

What to do with Null dates values

Saving Null Dates to SharePoint in Power Automate.

I am migrating workflows into Power Automate (PA). Part of these workflow handles the age-old SharePoint task of copying lookup values into normal SharePoint columns so they can be used within the list.  My problem is that some of these are Date columns that at different times in the list item's life will be blank.

PA will not allow you to write null date values.

Suggestions?

 

Trigger: On New or Modified

List Columns:

  • "GetDates" lookup column and include 3 additional date columns: GetDates:Date1, GetDates:Date2, GetDates:Date3.
  • Three Date/Time columns: Date1, Date2, Date3.
  • Other columns: 2 text, 1 note, 3 Yes/no...

Lookup date values:

  • On this run of the WF Only GetDates:Date1 has a date.

My data handling process - using Date1 as example.

  • Initialize Var: SP Date1 (string) = GetDates:Date1.
  • (workflow stuff happens)
  • At the end of the workflow I use Update Item to update all columns.
  • Outcome: Workflow fails with Date2 column being Null. The 'inputs.parameters' of workflow operation 'Update_item_List_Item' of type 'OpenApiConnection' is not valid. Error details: Input parameter 'item/Date2' is required to be of type 'String/date'. The runtime value '""' to be converted doesn't have the expected format 'String/date'.

I can't do multiple updates because they will trigger (on new and modify) again.

1 ACCEPTED SOLUTION

Accepted Solutions
efialttes
Super User
Super User

Hi!

So you have two challenges:

1.- How to update the item with a Date if your input Date (read from the trigger, right?) is null. So I believe you need to decide which default Date you will store in such case, and handle it by means of combining WDL functions like if() and empty() in a single expression.  

2.- How to avoid neverending loops. So there are several techniques, described in this article...

https://powernimbus.com/2019/06/microsoft-flow-avoiding-the-sharepoint-list-update-trigger-infinite-...

And a new approach based on a functionality recently released:

https://flow.microsoft.com/es-es/blog/run-a-flow-when-a-sharepoint-column-is-modified/

 

Please let us know your progress, if you find a blocking issue do not hesitate to write back and share screenshots from your current flow design

 

Cheers!

 



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



View solution in original post

1 REPLY 1
efialttes
Super User
Super User

Hi!

So you have two challenges:

1.- How to update the item with a Date if your input Date (read from the trigger, right?) is null. So I believe you need to decide which default Date you will store in such case, and handle it by means of combining WDL functions like if() and empty() in a single expression.  

2.- How to avoid neverending loops. So there are several techniques, described in this article...

https://powernimbus.com/2019/06/microsoft-flow-avoiding-the-sharepoint-list-update-trigger-infinite-...

And a new approach based on a functionality recently released:

https://flow.microsoft.com/es-es/blog/run-a-flow-when-a-sharepoint-column-is-modified/

 

Please let us know your progress, if you find a blocking issue do not hesitate to write back and share screenshots from your current flow design

 

Cheers!

 



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



View solution in original post

Helpful resources

Announcements
2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (2,107)