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

undefined

Hello

 

I am struggling with the following issue.

 

I have a flow that I have built to update all the items in a sharepoint list each night at a scheduled time.
The flow will run but errors when it encounters an Excel column with a blank instead of the date.

 

 

The error it provides is:

 

"Unable to process template language expressions for action 'Workflow_Completed' at line '1' and column '23558': 'In function 'converttimezone', the value provided for date time string '' was not valid. The datetime string must match ISO 8601 format.'."

 

Nobel8_0-1637786214581.png

Nobel8_1-1637786230284.png

Nobel8_2-1637786257941.png

 

 

I tried to use the following expression for workflow completed to ignore blanks, where workflow_completed in red points to the dynamic content in the convert time zone action:

 

if(empty(items('Apply_to_each_3')?['Workflow Completed']),null,body('Workflow_Completed'))

 

but I still get the same error.

 

Thank you advance for you help, and please let me know if any additional info is needed.

 

 

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
tom_riha
Super User
Super User

Hello @Nobel8 ,

the Convert Time Zone action can't have an empty input, therefore, if you use the condition and the input is null, the action won't like it - hence the error message.

I'd use the ConvertTimeZone expression instead of the action:

convertTimeZone(date, 'sourceTimeZone', 'destinationTimeZone', 'format')

I'd put it in the if(...) expression directly in the 'Create item' action. If the date is null, update null, otherwise convertTimeZone and store the date, it would go like:

if(empty(items('Apply_to_each_3')?['Workflow Completed']),null,convertTimeZone(items('Apply_to_each_3')?['Workflow Completed'],'Eastern Standard Time','Samoa Standard Time','d'))

The list of all available time zones is here: https://docs.microsoft.com/en-us/previous-versions/windows/embedded/ms912391(v=winembedded.11)



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]

View solution in original post

2 REPLIES 2
tom_riha
Super User
Super User

Hello @Nobel8 ,

the Convert Time Zone action can't have an empty input, therefore, if you use the condition and the input is null, the action won't like it - hence the error message.

I'd use the ConvertTimeZone expression instead of the action:

convertTimeZone(date, 'sourceTimeZone', 'destinationTimeZone', 'format')

I'd put it in the if(...) expression directly in the 'Create item' action. If the date is null, update null, otherwise convertTimeZone and store the date, it would go like:

if(empty(items('Apply_to_each_3')?['Workflow Completed']),null,convertTimeZone(items('Apply_to_each_3')?['Workflow Completed'],'Eastern Standard Time','Samoa Standard Time','d'))

The list of all available time zones is here: https://docs.microsoft.com/en-us/previous-versions/windows/embedded/ms912391(v=winembedded.11)



[ If I have answered your question, please Accept the post as a solution. ]
[ If you like my response, please give it a Thumbs Up. ]

[ I also blog about Power Automate solutions even for non-IT people. ]

View solution in original post

Thank you @tom_riha this worked.  Only item that was not functional was the link to current time zones as that gave me a 404

The list of all available time zones is here: https://docs.microsoft.com/en-us/previous-versions/windows/embedded/ms912391(v=winembedded.11)

Helpful resources

Announcements
Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Top Solution Authors
Top Kudoed Authors
Users online (2,930)