cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Post Patron
Post Patron

Convert time zone null when field is empty

I noticed that when a field I have date and time in is empty "convert time zone" returns error "null" and that makes sense. Someone know how I can go around this?

 

I've tried some things put cant get it to work, i've searched the forum too.

 

My flow looks like this:

converttimezonenull.PNGconverttimezonenull2.PNGconverttimezonenull3.PNG

17 REPLIES 17
Super User III
Super User III

Hello @288088 

 

So if I understand correctly, you might have a situation where that date field is empty. But when this happens, the flow fails and throws an error?

 

So instead of throwing an error, you want the flow to continue?

 

If that is the case. I would enable run after on the action after the one that fails on empty date.

You can do this by:

Clicking the 3 dots on the action, clicking configure run after, than checkbox Succeed, and Failed.

This is saying the action will run if the action above fails or succeeds.

 

—Josh
If you like my post please hit the "Thumbs Up" -- If my post solved your issue please "Mark as a Solution" to help others





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

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!


Check out my blog for Power Automate tips, tricks, and guides
FlowAltDelete




Hi @288088 ,

 

You can try the option what @Jcook  suggested.

Or you can try a condition to check id date is null, option (no the best ;):

CheckNULL1.png

 

-----------------------------------------------------------------------------------------------

If you like my post please hit the "Thumbs Up" -- If my post solved your issue please "Mark as a Solution" to help others

 

Thata exacly what I mean. I tried exacly what you said but with no luck. It says same error message "null" =(

I will try this sooner, i'll be back

@288088 

You need to enter null in the expression window rather than as just text.  If you do so, your condition will look similar to the screen shot below:

NullDate.jpg

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

Hi @ScottShearer 

 

I noticed this while ago too but recently flow started to understand 'null' text. but if this is the case we need to better understand i think. i was very confused when it works for me with plain text actually.

 

@DeepakS 

You are correct - it will work by entering null as plain text rather than as an expression.  This never worked before and I haven't seen anything saying it should work now but it does.....

I also created a condition to test for true or false.  It worked when I entered true or false as plain text or in the expression window.

I know that enhancements are being made to expressions and the expressions interface in Power Automate - I suspect that the behavior we are seeing is part of those changes.

 

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

Now i've tried some but I cant get it to work, still getting the error.. 😞

 

This is the flow I got right now:

converttimezonenull still error.PNG

converttimezonenull still error2.PNG

 

The error message i get:

errormessage.PNG

HI @288088 ,

 

You have 4 "convert to time " action but only checking three date in condition block for null. Please make sure you  have all 4 date column in condition block.

 

Regards,

Hi!

Jut in case it helps, I tend to use coalesce() expression in order to evaluate if  a sharepoint column is empty, so I add two parameters inside:

-the column value

-a default text, just in case column value is null

So if i am inside an apply to each iterating all through the items from a 'Get item', and the column is named 'myColumn', the expression would be

 

coalesce(items('Apply_to_each')?['MyColumn'],'myDefault')

 

Now, you can use it in a condition (not very fficient if you are inside an Apply to Each), or, in some scenarios a default value works like a charm

 

Hope this helps

 



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!



i'm sorry but this wont work for me 😞

I'm sorry I dont really get it. Do you mean I should do something like this?

 

converttimezonenull still error3.PNG

I tried to put this expression inside convert time zone but I get this error:

 

error convert time zone.PNG

 

Using this expression:

coalesce(items('Apply_to_each')?['Sovtid tekniker 1'],'myDefault')

 

error convert time zone2.PNG

Hello again! Someone who know what could be wrong? 🙂

Hi!

I think there are two problems with the current expression you are using:

coalesce(items('Apply_to_each')?['Sovtid tekniker 1'],'myDefault')

One is that yuo shuld replace 'myDefault' and use a valid defaultDate that will be assigned in case your item column value was not defined, for example:

"1900-01-01T00:00:00.0000000Z"

 

Second, is the fact that you used special characters in your Sharepoint Column Name -two spaces in 'Sovtid tekniker 1'-, meaning you need to figure out which is the internal column assigned to it by Sharepoint. Some people prefer to inspect the value by looking flow execution outputs, some others just add a dummy Compose action block inside the apply to each, assign as its input the column value from 'Dynamic content' menu, hover the mouse over it and check the internal name.

 

Hope this helps



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!



This worked, but now it shows "1900-01-01 01:00" in the email where there is supposed to be blank, doesnt look that great. Isnt there anyway to avoid that text?

@288088 

 

Out of curiosity have you tried what I had recommended?

 

  1.  null will cause the time conversion operation to fail, but still creates a time object.
  2. In the action immediately following the Convert time zone action, set the Configure run after to run after success and failure.
  3. Do this for every action that comes after a Convert time zone action.

Doing this will fix all the issues you have been having. 

 

 

—Josh
If you like my post please hit the "Thumbs Up" -- If my post solved your issue please "Mark as a Solution" to help others





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

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!


Check out my blog for Power Automate tips, tricks, and guides
FlowAltDelete




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!

Microsoft Ignite

Microsoft Power Platform: 2021 Release Wave 1 Plan

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

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 (5,431)