Cannot perform operation on system.string and system.int32

I’m new to UiPath and I’m trying to update the Status column in gsheet based on whether or not approval is made. Please see SS whether I’m stuck

Here’s the code I’ve

Result_from_Read_Range.Select(String.Format(“Sno = {0}”, CurrentRow(“sno”).ToString)).FirstOrDefault

Please assist.

Hi @Kumaresan_Boopathy
In Value you have to give Variable
In Row give CurrentRow
image


@lrtetala Thanks but that didn’t help. Here’s how the data is taken from the gsheet.

Here’s how the data is published back to gsheet once the tool completes execution.

@Kumaresan_Boopathy

Welcome to the community

As per error Sno is of type integer and you are trying to compare with currentRow(“sno”).ToString which is a string…so it is failing

Please try using

Result_from_Read_Range.AsEnumerable.Where(function(x) x("Sno").ToString.Equals(CurrentRow("sno").ToString)).FirstOrDefault

Cheers

@Anil_G
Thanks for the response, please see the error message in the SS attached. Kindly advice the next step.
image

@Kumaresan_Boopathy

I believe you copy pasted the code exactly…please remove inverted comma and add again in the advanced editor window

Correct - "
Wrong -

Cheerd

@Anil_G Thank you and your solution worked. But I’m getting a new error message like “Single Excel Process Scope: Could not parse Microsoft Excel version: $”

Your solution is implemented in 2 places. If and then Else not sure that’s causing the error.

@Kumaresan_Boopathy

It looks like the excel process issue…

May be the excel is locked as you are using in loop or so

cheers

@Anil_G I went through this solution for Excel. But, I’m having this error in gsheet and it doesn’t even allow me to run it.

@Kumaresan_Boopathy

Can you show a screenshot of the error…

The solution is no way related as this works on datatables…are you using output of this in gsheet activities?

if so check the variables from locals panel if they are as expected

cheers

@Anil_G
Here’s the screenshot of the error message. Yes, I’m trying to update a value in Gsheet through the If condition and a diff value through Else.

@Kumaresan_Boopathy

Are you getting this on any activity…please run in debug and check

also if you are using excels then make sue to use excel process scope instead of single excel scope

cheers

@Anil_G I couldn’t do anything bcz of this error and can’t bypass it as well.

@Kumaresan_Boopathy

May I know why are you suing excel process scope for gsuite activities?

it s not needed…it works only for excel related activities

cheers

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