cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Jouv
Regular Visitor

Convert string from array to integer

Hello Community,

 

I'm parsing a table out from a mail with power automate. I just need to get the last item of the table. I managed to get this specific row and manage do store it into a variable.

But i failed to convert it to integer.

My data can takes several forms like : 480 000 or just 0 or -0,03 or 452 000,23.

All i want is to convert the string into integer in order to make some logical test with the data after.

 

Today i have error when compose data with int() formula.

 

Jouv_1-1634547248010.png

 

Jouv_2-1634547292456.png

 


 

 

Best regards,

 

Kair0

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @Jouv :

The key is that 125.2, -0.03 and other decimal values are all floating-point numbers, they are not integers.vbofengmsft_0-1634626713903.png

You'd better try:

float(trim(output(var)))

Best Regards,

Bof

View solution in original post

3 REPLIES 3
Mira_Ghaly
Dual Super User II
Dual Super User II

@Jouv 

Did you try to use the trim expression before converting to INT?

 

If this post helps you with your problem, please mark your as Accepted solution.If you like my response, please give it a Thumbs Up.

Blog: here

Hello @Mira_Ghaly ,

 

trim does not the same thing like in excel. It just remove blank space before and after not between.

when my variable is equal to 125,2 or -125,25 or -0,03, int(trim(output(var))) will fail.

Hi @Jouv :

The key is that 125.2, -0.03 and other decimal values are all floating-point numbers, they are not integers.vbofengmsft_0-1634626713903.png

You'd better try:

float(trim(output(var)))

Best Regards,

Bof

Helpful resources

Announcements
2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Users online (1,303)