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
Super User

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 blog
Power Automate Video Tutorials

View solution in original post

7 REPLIES 7
fchopo
Super User
Super User

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
Super User

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 blog
Power Automate Video Tutorials
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  ?

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 blog
Power Automate Video Tutorials

Helpful resources

Announcements
 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Users online (1,894)