Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Unanswered

Struggling with convertToUTC function

(0) ShareShare
ReportReport
Posted on by 129

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

  • PrasadAthalye Profile Picture
    on at
    Re: Struggling with convertToUTC function

    @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.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard >