cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
fshaikh
Advocate II
Advocate II

Convert stings into values when extracting data from Excel in Flow

Hi,

I wish to convert strings into values when extracting data from Excel in Flow.

As you can see the below screenshot of my Data in Excel, I'm trying to get the sum of and Names = "Tim" and pass it to outlook connector. With ODATA filter query I was successfully in getting the data for Tim only now the challenge came up when I tried to sum the value by apply to each there is error " The provided value is of type 'String' ", I would appreciate community support in resolving this issue or suggest me better solution for this scenario. 

 

Data In Excel :

Snag_14a891b7.png

 

Error : 

Action 'Set_variable' failed

 

Snag_14aa11b0.png

My Flow :

Snag_14ab2e2c.png

Snag_14ac515f.png

 

Thanks in advance..

 

Regards, Faraz Shaikh 

 

 

  

2 ACCEPTED SOLUTIONS

Accepted Solutions

Hi @fshaikh 

 

Step where you adding the value , use float instead of int.

add(float(items('Apply_to_each')['Amounts']),float(variables['Total']))

 

Regards,

DS

View solution in original post

Hi @DeepakS 

 

Tested & it worked out with success thanks for you response.

 

Snag_16e5690e.png

 

this green color is sigh of relief 😀 

 

Red highlight was the missing peace of code

 

add( float( items('Apply_to_each')['Amount'), variables('Total'))
 
Snag_16e445cc.png

Regards, Faraz Shaikh 

 

View solution in original post

4 REPLIES 4
DeepakS
Super User
Super User

Hi @fshaikh 

 

You should convert the string to integer before performing sum. You can use int() function do that:

add(int(string value from excel),int(string value from excel))
 
Regards,
DS

Hi @DeepakS 

 

Thanks for you reply.. which step should I apply this formula in my flow & i need to use float as I few of decimal values.

 

appreciate your feedback

 

Regards, Faraz Shaikh 

Hi @fshaikh 

 

Step where you adding the value , use float instead of int.

add(float(items('Apply_to_each')['Amounts']),float(variables['Total']))

 

Regards,

DS

View solution in original post

Hi @DeepakS 

 

Tested & it worked out with success thanks for you response.

 

Snag_16e5690e.png

 

this green color is sigh of relief 😀 

 

Red highlight was the missing peace of code

 

add( float( items('Apply_to_each')['Amount'), variables('Total'))
 
Snag_16e445cc.png

Regards, Faraz Shaikh 

 

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Users online (1,994)