Skip to main content
Community site session details

Community site session details

Session Id : 4kB3hVVmn4xJOqDfvIxB7m
Power Automate - Using Connectors
Answered

Time column from Postgresql formatting

Like (0) ShareShare
ReportReport
Posted on 17 Apr 2023 08:27:57 by 32

I have a table with a column with the "time" datatype.

Byt when i fetch data from it, it gets this weird formatting.

07:03:22 becomes PT7H3M22S.

 

Any way of getting Power Automate to do this like normal people?

  • shakudu Profile Picture
    32 on 20 Apr 2023 at 08:44:02
    Re: Time column from Postgresql formatting

    Thank you, i was hoping that there was a database-related solution to this but it seems Postgres is anything but straightforward in Power Automate.

    I unfortunately had to make it with conditions forhours, minutes and seconds because is minutes was 00 in the database it would show up as 7H23S, messing up the split. But thank you for helping me find the way, i accepted your suggestion as the solution.

  • Verified answer
    v-zhoqian-msft Profile Picture
    Microsoft Employee on 17 Apr 2023 at 09:17:42
    Re: Time column from Postgresql formatting

    Hi @shakudu ,

     

    The direct method is to extract numbers through the split function:

    vzhoqianmsft_0-1681722931569.png

    first(split(outputs('Compose'),'H'))
    first(split(last(split(outputs('Compose'),'H')),'M'))
    first(split(last(split(last(split(outputs('Compose'),'H')),'M')),'S'))
    formatDateTime(outputs('Compose_2'),'HH:mm:ss')
     
    vzhoqianmsft_1-1681723016090.png

     

     

     

    Best Regards,

    Habsburg Qian

    If this post helps, then please consider Accept it as the solution to help the other members find it.

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

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Tomac Profile Picture

Tomac 986 Moderator

#2
stampcoin Profile Picture

stampcoin 699 Super User 2025 Season 2

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 577 Super User 2025 Season 2

Featured topics

Loading complete