How to perform mathematical operations on two numbers in UiPath?

I have a scenario where I need to add 2 numbers which are stored inside 2 variables in UiPath and display it in a message box. But when I type in ‘+’ operator between them, it’s concatenating the two variables instead of adding them. So can anyone help me out with this issue?

Hi @vivek_Chowdary
Your variable type should be Int32. then it will add that two values.

@jitendra_123

If I change the type from GenericValue to Int32, what’s the vb.net command to get that value and store it in a vaiable?

Find the attachment it will help you. I have taken input from Two input Dialogues.AddTwoNumbers .xaml (5.2 KB)

1 Like

@jitendra_123

This is fine. I know how to implement this using input dialogues. But how can I achieve this by fetching values from an excel file?

Use the read range to read the excel file after that read for each activity to read the file row by row. after that use Get row item activity to get value from excel int a variable and do the addition on that.

Can you please explain to me how to use the Get row item activity.

You have to just provide the column name or column index to this activity.

its still not working. Its displaying an error when I change the type.

Did you already follow the course on academy? If not, that’s where you need to start

https://academy.uipath.com/

I already finished the course.

@c.ciprian If you know the answer please try to give a solution instead of asking me to go through the entire course again.

Can please attach your work flow file for more reference ?

The Read Row activity outputs an IEnumerable. You need to take your objects from there, convert them to integers and now you can add them.

Hi @vivek_Chowdary
Please find the attachment.AddNumbers.zip (3.0 KB)

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.