cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AlessandroP
Helper II
Helper II

How to convert string HH:MM in integer

Dear Experts

 

I have a csv file that provides a column called Time  in format HH:MM.

 

I need to feed the values of this column in a data connector and it accepts only INT32 data type.

 

How do I convert then from HH:MM into INT32 in Power Automate?

 

Any help would be highly appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions
jinivthakkar
Dual Super User
Dual Super User

@AlessandroP in continuation of yesterdays flow I have add following steps which gives me int value for HH and MM separately then you can use as required

 

jinivthakkar_0-1613390890328.png

 

Entire flow 

jinivthakkar_1-1613391028583.png

 

Refer this link for details of the flow : https://powerusers.microsoft.com/t5/General-Power-Automate/How-to-convert-string-dd-mm-yyyy-hh-mm-to...

 

Hope this helps.

 

--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

View solution in original post

5 REPLIES 5
jinivthakkar
Dual Super User
Dual Super User

@AlessandroP in continuation of yesterdays flow I have add following steps which gives me int value for HH and MM separately then you can use as required

 

jinivthakkar_0-1613390890328.png

 

Entire flow 

jinivthakkar_1-1613391028583.png

 

Refer this link for details of the flow : https://powerusers.microsoft.com/t5/General-Power-Automate/How-to-convert-string-dd-mm-yyyy-hh-mm-to...

 

Hope this helps.

 

--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

Paulie78
Super User
Super User

2021-02-15_12-21-52.png

AlessandroP
Helper II
Helper II

I don't think this is going to solve my issue 

 

I need to convert for example the time 23:32 into an integer.

I don't need to convert into integer 23 and 32.

I need the formula to convert the time into an integer.

AlessandroP
Helper II
Helper II

Now, I get it

 

essentially the field time is expressed in seconds therefore I need to calculate the number of seconds from the time expressed in hours and minutes.

Thanks to the splitting you suggested ,  I can bulid the formula  Number of hours * 3600 + number of minutes * 60

 

 

AlessandroP_0-1613432370767.png

 

Thank you for the help

 

AlessandroP
Helper II
Helper II

This is the formula I used 

add(mul(int(outputs('Split_Hours_and_minutes')[0]),3600),mul(int(outputs('Split_Hours_and_minutes')[1]),60))

Helpful resources

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

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

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.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Users online (1,622)