Showing results for 
Search instead for 
Did you mean: 
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?


Community Champion
Community Champion

@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

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (2,589)