How to add two variable IEnumerable together in a simple excel cell?

Hello everyone,

I tried to recover some image on a web page, (like you can find here https://forum.uipath.com/t/how-to-differentiate-two-images-who-are-the-same-for-uipath-not-for-me/135066 and when this will work for another website I had to add 2 numbers in a simple Excel cell.

So I have my two variable returned as a IEnumerable type by my “Find Image Matches” and I want to add them in the excel cell, I can add one variable in his own cell but when I tried to add them in the same cell they just are concatenate like if I have “10” and “1” in Excel this will be “101” when I want “11”.

I try to convert them but nothing work in my case, maybe you know how to do it ?

Thank you

You want to add each result in different excel table?
If you have multiple results in IEnumerate you should use For loop and then Append each of the results in next row of excel table

I have to complete ten cell, for most of them it’s easy I just have to find the number of the image appear in the website and store the result with a for each loop.

My problem is because for one cell of the Excel I have to store in the number of two images appear, so if image one appear 5 times and image two appear 8 times I have to store “13” in the cell but I only have the result of “5 AND 8” in the cell so “58” instead of “13”.

Oh, okay, just turn them into Int variables then use +.

So use CINT(Result(0)) + CINT(Result(1))

I tried to do it but UiPath say I can’t convert from IEnumerable to Int with a “Assign” activity like that, I tried to bypass it by using multiple “Assign” activity but this is not working as well.

This is my file.xaml, maybe you can try to do it on it and show me how you do ?

Test.xaml (13.8 KB)

Thank you

Try

CINT(nbticketsStorm(0).toString)+ CINT(nbticketsStorm(1).toString)

Directly in the “write cell” activity ? Or I have to pass by “Assign” activity before ?

Well you can test it with message box activity and see if you get the desired result. If you get it you can either put the value to a variable (if you use it in several places) or directly in write cell activity.

UiPath return me an error

“Conversion from string “UiPath.Core.UiElement” to type ‘Integer’ is not valid.”

Exception type : System.InvalidCastException