cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
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
Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Users online (66,113)