cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper I
Helper I

Converting timezones for a HTML table

Hi All, 

Wanting to convert from UTC to E. Australia Standard  keeping getting failed runs

 

Column name is:-  Date&timeofincident

Settings edit column value on SharePoint for column is:-  Date%5Fx0026%5Ftimeofincident

 

Expression that I am using is:- convertFromUtc(item()?['Date%5Fx0026%5Ftimeofincident'],'E. Australia Standard Time', 'dd/MM/yyyy hh:mm')

 

Message after running Flow is:-

The execution of template action 'Create_HTML_table' failed. The column values could not be evaluated: 'The template language function 'convertFromUtc' expects its first parameter to be a string that contains the time. The provided value is of type 'Null'. Please see https://aka.ms/logicexpressions#ConvertFromUtc for usage details.'.

1 ACCEPTED SOLUTION

Accepted Solutions

You could use expression like following instead of just convertFromUtc expression. This expression checks the value of the column whether it is empty, if value is empty, then we dont need to convert timezone, otherwise do convert timezone 

 

if(empty(item()?['Cat1_x003A_Oncallverballynotifie']),'no value', convertFromUtc(item()?['Cat1_x003A_Oncallverballynotifie'],'E. Australia Standard Time', 'dd/MM/yyyy HH:mm'))

 

Regards,
Anna Jhaveri

If I have answered your question, please mark the post as Solved to help other users to identify the correct answer
If you like my response, please give it a Thumbs Up.

View solution in original post

9 REPLIES 9
Super User
Super User

Is the value of the column Date%5Fx0026%5Ftimeofincident empty for any records in SharePoint that are being used in the flow?

Regards,
Anna Jhaveri

If I have answered your question, please mark the post as Solved to help other users to identify the correct answer
If you like my response, please give it a Thumbs Up.
Helper I
Helper I

Hi Anna,

 

No records are empty in this column

Helper I
Helper I

Anna, my apologies.

 

I solved the issue for the original column by replacing the %5F with an _

 

Now I have moved to the next column in the table and it does contain empty records. Is there a way I can work around this?

Are you looping through items? You can use expression to check whether column is null or not, and put a value when column value is null

if(empty(items('Apply_to_each_2')?['DueDate']),'no value',items('Apply_to_each_2')?['DueDate'])
Regards,
Anna Jhaveri

If I have answered your question, please mark the post as Solved to help other users to identify the correct answer
If you like my response, please give it a Thumbs Up.
Helper I
Helper I

Hi Anna,

Where  and how would I use this expression?

 

 

@MattJ  Could you please share screenshot of the flow, action where you are getting the null error, so that i can see how you are using the column that has nul value so that i can guide where and how to use the expression

Regards,
Anna Jhaveri

If I have answered your question, please mark the post as Solved to help other users to identify the correct answer
If you like my response, please give it a Thumbs Up.
Helper I
Helper I

Hi Anna,

The flow looks like image below - the expression that I am using to convert the timezone is

convertFromUtc(item()?['Cat1_x003A_Oncallverballynotifie'],'E. Australia Standard Time', 'dd/MM/yyyy HH:mm')

 

The error is

080121-Flowd.png

https://prod-08.australiasoutheast.logic.azure.com/workflows/37682a0d439d49a691a8bde5afa72177/runs/0...

 

080121-Flowc.png

You could use expression like following instead of just convertFromUtc expression. This expression checks the value of the column whether it is empty, if value is empty, then we dont need to convert timezone, otherwise do convert timezone 

 

if(empty(item()?['Cat1_x003A_Oncallverballynotifie']),'no value', convertFromUtc(item()?['Cat1_x003A_Oncallverballynotifie'],'E. Australia Standard Time', 'dd/MM/yyyy HH:mm'))

 

Regards,
Anna Jhaveri

If I have answered your question, please mark the post as Solved to help other users to identify the correct answer
If you like my response, please give it a Thumbs Up.

View solution in original post

Helper I
Helper I

Hi Anna,

 

that is so kind and generous of you. thanks so much for your help

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 (13,489)