cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mmattar
Responsive Resident
Responsive Resident

SP Null Date Column

Hello,

 

I am trying too perform an "update item", sometimes my date columns have empty values but i am getting an error: 

 

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

 

The Date columns are already empty, I just want to do 1 update item, so i pass the variables thru it regardless if empty or not. How can i make this work ? 

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
abm
Super User III
Super User III

Hi @mmattar 

 

You can't declare a string and initialise with null and update the list item in SharePoint.  The reason for this is null is not a string. Use the IF expression under the dynamic mapping like below.

 

if(not(empty(variables('varDate'))),variables('varDate'),null)
 
Above I am using variable string called varDate. Don't initialise with anything.

 

Please follow the below

 

image.png

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blogPower Automate Video Tutorials

View solution in original post

7 REPLIES 7
fchopo
Super User II
Super User II

Hello @mmattar 

Instead of passing the "" value to the date column, try to use the null expression:

null.png

 

Hope it helps!

Ferran

Did I answer your question? Please consider to mark my post as a solution to help others.
Proud to be a Flownaut!
mmattar
Responsive Resident
Responsive Resident

Oh yes sorry I forgot to mention that I do update my variables to null if needed and I still get that same error

Hello @mmattar 

Could you share your flow and show some of the output values? Really weird...

Regards,
Ferran

Did I answer your question? Please consider to mark my post as a solution to help others.
Proud to be a Flownaut!
mmattar
Responsive Resident
Responsive Resident

When i set my variable you can see i set it to null, in this case 2 date columns got values but 2 did not and you can see the error it throws me because it. 

 

tm2.PNGtm1.PNGtm.PNG

abm
Super User III
Super User III

Hi @mmattar 

 

You can't declare a string and initialise with null and update the list item in SharePoint.  The reason for this is null is not a string. Use the IF expression under the dynamic mapping like below.

 

if(not(empty(variables('varDate'))),variables('varDate'),null)
 
Above I am using variable string called varDate. Don't initialise with anything.

 

Please follow the below

 

image.png

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blogPower Automate Video Tutorials

View solution in original post

mmattar
Responsive Resident
Responsive Resident

Thank you, this worked. 

 

Now since i have a trigger that "When an item or file is modified", it looks like when my flow does an update item it runs again and again cause the record is being modified, how can i stop this loop  ?

abm
Super User III
Super User III

Hi @mmattar 

 

Good question. So you could use created on and modified on date to compare. When you create the record most likely these values are almost same. Probably some minor difference in seconds. 

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blogPower Automate Video Tutorials

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Top Solution Authors
Users online (998)