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
User Groups Public Preview

Join us for our User Group Public Preview!

Power Automate User Groups are coming! Make sure you’re among the first to know when user groups go live for public preview.

MSFTBizAppsLaunchEvent

Experience what’s next for Power Automate

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Users online (31,536)