Error when trying to do a condition in if activity

I’m getting this error and I don’t know how to fix it?

You probably have CurrentRow(“columnname”) which is an object. You have to include conversion to an actual datatype ie CurrentRow(“columnname”).ToString but since you are comparing to what appears to be a dollar amount, you’ll want to do…

CDbl(CurrentRow("columnname").ToString)

You use the .ToString to output the value, then convert it to a double (ie decimal number) by wrapping it in CDbl()

1 Like

I tried that but then this error came up:

I also tried this : CurrentSharePrice <= CDbl(CurrentRow(“Expected Price”).ToString)

Or is that not right?

I’m trying to write a condition that compares the current share price <= to the expected price in excel

@Sara_Piana

Try this

Cdbl(CurrentSharePrice )<= CDbl(CurrentRow(“Expected Price”).ToString)

Cheers

1 Like

Yay it worked! Thank you😊

1 Like

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