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

Allow Null value for covertimezone expression

My purpose: add a convertimezone expression in my flow and also allow the user to leave as blank

 

My problem: if users leave date as blank, the flow will fail as below: 

 

 

565.PNG

 

1 ACCEPTED SOLUTION

Accepted Solutions

 

Hi @picnicfunL ,

 

You could try to use the If() function to determine if the Date field value is empty and if so, do nothing. If it is not empty, execute the convertTimeZone() function.

34.PNG

Expression reference:

if(equals(triggerBody()?['Date'],null),'',convertTimeZone(triggerBody()?['Date'],'Dateline Standard Time','Central Standard Time','yyyy-MM-dd'))

 

Best Regards,

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

View solution in original post

6 REPLIES 6
Super User II
Super User II

@picnicfunL 

Hi there!  Are you using the date later in the Flow?  Wondering if you can just use UTCNow() if it is blank, and then just ignore the output of this step later?

 

Just a thought.

-Ed-

 

If this reply has answered your question or resolved your challenge, please consider marking it as a Solution. This helps other users find it more easily via search.

Yes, I need the time for email, also the time is not "now" so I am not able to use UTCnow()

Capturefef.PNG

So, If it's required, what is your intent if the user leaves it blank?

It depends on the situation, at the begin, users don't know the correct time, they will fill out the time when the event is restored. 

Now I add condition " time is equal to ture"

It might help if you can chart out what the journey should look like, right?  It sounds like there is information required before the user actually has it, in some cases.  If that's the case, it might be necessary to plug in a 'sample' value to move forward, and then update it later.

 

Keep us posted.

-Ed-

 

 

Hi @picnicfunL ,

 

You could try to use the If() function to determine if the Date field value is empty and if so, do nothing. If it is not empty, execute the convertTimeZone() function.

34.PNG

Expression reference:

if(equals(triggerBody()?['Date'],null),'',convertTimeZone(triggerBody()?['Date'],'Dateline Standard Time','Central Standard Time','yyyy-MM-dd'))

 

Best Regards,

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

View solution in original post

Helpful resources

Announcements
PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

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!

Top Solution Authors
Users online (4,635)