cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
StevenWade
Advocate III
Advocate III

Struggling with convertToUTC function

I've built a flow that seems to be randomly generating errors on the convertToUTC function, and it's driving me batty. I'm applying the convertToUTC function against a text formatted date in order to stuff the data to a SQL table that is expecting a datetime format. 90% of the time, the convertToUTC function works correctly. The other 10% of the time, I get "the value provided for string '#####' is invalid". The timestamps can be from the same day, within hours of each other, and an error is thrown. The image below provides snapshots of both failing and working examples. The convert to UTC function is written as follows:

 

 

convertToUtc(outputs('Rewrite_JSON_for_current_record')['BRET_STATE_TIMESTAMP'], 'UTC', 'G')

 

 

PLEASE HELP! What am I doing wrong here? Should I be reporting this as a defect?

error_msg_1.JPG

1 REPLY 1
PrasadAthalye
Super User
Super User

@StevenWade   - Can you try to use formatDateTime() function on DB column and then convert and see if it goes through?

 

Like and Mark this as answer if it resolves your issue.

Please Like and Mark this as Answer if it resolves your Issue.

Power Automate Community

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Users online (1,413)