Getting 'Option strict on disallows implicit conversion from String to boolean'

Hi team,

I am getting following error when i try to use the get text variable in if condition.
Please help me to solve this.

image

@Bhagyashree_S condition only accept bool expression or bool variable and you are giving string to condition

Hi,

Can you try the following condition?

EXIST isnot Nothing AndAlso (not String.IsNullOrEmpty(EXIST))

image

Regards,

HI @Bhagyashree_S

How about the condition?

IsNothing(yourVariable) OrElse String.IsNullOrEmpty(yourVariable.ToString)

Regards
Gokul

Hi @Yoichi

Its working but its failing when it needs to enter in RESULT column of excel sheet.

image

It says
Assign: Exception has been thrown by the target of an invocation.

@Bhagyashree_S use row(“Result”)

HI,

Can you share content of $ExceptionDetails in Locals panel when it stops?
And also share content of left side of the Assign activity?

Regards,

In assign activity i have used

row.Item(RESULT) = EXIST

image

Hi,

Can you share $exceptionDetails as the following?
Please click magnifier button and share its whole content as text.

image

Regards,

Hi,

RemoteException wrapping System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. —> RemoteException wrapping System.ArgumentException: Column ‘RESULT’ does not belong to table DataTable.
at System.Data.DataRow.GetDataColumn(String columnName)
at System.Data.DataRow.set_Item(String columnName,
Object value)
— End of inner exception stack trace —
at System.RuntimeMethodHandle.InvokeMethod(Object target,
Object arguments,
Signature sig,
Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj,
Object parameters,
Object arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj,
BindingFlags invokeAttr,
Binder binder,
Object parameters,
CultureInfo culture)
at System.Activities.ExpressionUtilities.IndexerLocationFactory1.IndexerLocation.set_Value(T value) at System.Activities.Location1.ReferenceLocation.set_Value(T value)
at System.Activities.ActivityContext.SetValueCore[T](LocationReference locationReference,
T value)
at System.Activities.ActivityContext.SetValue[T](LocationReference locationReference,
T value)
at System.Activities.Argument.Set(ActivityContext context,
Object value)
at System.Activities.Statements.Assign.Execute(CodeActivityContext context)
at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance,
ActivityExecutor executor,
BookmarkManager bookmarkManager)
at System.Activities.ActivityInstance.Execute(ActivityExecutor executor,
BookmarkManager bookmarkManager)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor,
BookmarkManager bookmarkManager,
Location resultLocation)

Hi,

This message shows there is no “RESULT” column in your datatable. Can you check columnname of the target column. It might contain extra whitespace etc.?

Regards,

Hello @Bhagyashree_S
If conditions is working based on boolean(True/False)
If you need to work in string, then comare your value with some other value.
For eaxmple, You getting “Hello” from get text amd stored in variable as YourString, then use the condition on IF be like, YourString="Hello" or YourString.contains("Hello"), it returns boolean response and process will go then, and vale changes, it willl goes to else

Regards
Gokul Jai

Check your Excel sheets having “Results” Column, Sometimes Space may be in excel sheets like "Results " Its may affects. so ensure your excel file

row(result).tostring=“EXIST” in if condition

try like that

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