cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Converting Text String list into Numbers (Float) _ [solved]

ivan3
Deputy Chef I
Deputy Chef I

Hello everyone! I'm sort of new to Workato and need some help!


I have to collect a list of values called Final Balance Due and then add them up to generate one final number. The problem is that the original datapill is a text string (even thoug it has only a number).

I used a Lists by Workato action to generate the list and I was able to clear its extra text by using the .pluck formula and (in the step 9) I ended up with a array/list that looks like this:


[nil, 4750.0, 11570.19, 3000.0]


When I try to use the .to_f formula I ge this error: Error calculating input for field 'value': undefined method `to_f' for #<Array:0x00007ff2cee20180>


but I can't convert this to float to be able to sum it... Any thoughts? Thank you in advance!! 


Here is my recipe: https://app.workato.com/recipes/2507257?st=7c5c792d31d65370e446c338841f64b1e070962785b860598c31a32d9...

10 REPLIES 10

ashwin-ashok
Deputy Chef I
Deputy Chef I

Hi Ivan,


I'm quite new to this myself, but I'll try my best to help you out.

I can see that there is a nil present in your Array, so you will have to omit that using a compact function.


After that, you can try creating a Repeater Helper and assign the list size to it.

Then drag in a Repeater and convert each item to integer as shown in the screenshot below:




Then you can pluck the key and sum it.




I how that helps.


Kind Regards,

Ashwin A.K