cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
rensalzado
New Member

Problems converting string to int/float in an Apply to Each Step

Hi, 

I am trying to multiply two quantities, from a SharePoint List. In the SharePoint List, these values are numeric, but when referenced in the flow, they seem to be a string. I tried to apply the function float() or int(), but when I do, I get a 0. Any ideas? The pictures are a simplify step of what I need. 

I need this number (FTE) to be later multiply with another. However, because this step returns 0, then the multiplication yields also 0. I would appreciate any hints you could provide. Many thanks! In the pictures I show that the field FTE = 2, but when I apply float(outputs('Get_item')?['body/FTE']) this yields 0

SharePoint1.pngSharePoint2.png

1 ACCEPTED SOLUTION

Accepted Solutions
v-bofeng-msft
Community Support
Community Support

Hi @rensalzado :

Please try this expression:

float(items('Apply_to_each')?['FTE'])

Best Regards,

Bof

View solution in original post

2 REPLIES 2
v-bofeng-msft
Community Support
Community Support

Hi @rensalzado :

Please try this expression:

float(items('Apply_to_each')?['FTE'])

Best Regards,

Bof

View solution in original post

Hi @v-bofeng-msft

Yeap, right on spot. I had to make a small change, because I renamed my "Apply to each" step to "Apply to each Eng Software Item": 

items('Apply_to_each_Eng_Software_Item')?['FTE']

 so, for whoever out there, consider that in your solution. 

 

Another things, at the end I did not need the float conversion. I could confirm that my field inherited the properties from the list (all along a float). In SharePoint lists, for calculated fields, even if you declare them as float/number, you have to use the conversion using "float". In this case, my problem was in the iterator.  

 

@v-bofeng-msft  where in the documentation can I find these small subtleties, at least with this action? I thought it had to do with the iterator, but honestly could not find any explanation to a special treatment for items when you are in the "Apply to each" steps.  

 

In any case, thanks for the help! I was scratching my head for one day because of that. I ended up do it manually ☹️

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Carousel April Dunnam Updated 768x460.jpg

Urdu Hindi D365 Bootcamp

Dont miss our very own April Dunnam’s The Developer Guide to the Galaxy! Find out what the Power Platform has to offer for the traditional developer.

Users online (3,165)