Assign status Value: DataTable internal index is corrupted

Assign status Value: DataTable internal index is corrupted: ‘4’.

Could someone help me with the below error?

dtTemp

primaryEmail,name.givenName,name.familyName,orgUnitPath,suspended,suspensionReason,creationTime,lastLoginTime,customSchemas.WOWCustomSchema.ADID,customSchemas.WOWCustomSchema.SAPID,customSchemas.WOWCustomSchema.EmployeeNumber,LicensesCount,Licenses,LicensesDisplay,Product Name,Extract Date,Status

drPortalextract

primaryEmail,name.givenName,name.familyName,orgUnitPath,suspended,suspensionReason,creationTime,lastLoginTime,customSchemas.WOWCustomSchema.ADID,customSchemas.WOWCustomSchema.SAPID,customSchemas.WOWCustomSchema.EmployeeNumber,LicensesCount,Licenses,LicensesDisplay,Product Name,Extract Date

exception:

RemoteException wrapping System.InvalidOperationException: DataTable internal index is corrupted: ‘4’.
at System.Data.RBTree1.GetNewNode(K key) at System.Data.DataTable.SetNewRecordWorker(DataRow row, Int32 proposedRecord, DataRowAction action, Boolean isInMerge, Boolean suppressEnsurePropertyChanged, Int32 position, Boolean fireEvent, Exception& deferredException) at System.Data.DataTable.InsertRow(DataRow row, Int64 proposedID, Int32 pos, Boolean fireEvent) at System.Data.DataRowCollection.Add(Object[] values) at lambda_method(Closure , VB$AnonymousType_12 )
at System.Linq.Enumerable.WhereSelectEnumerableIterator2.MoveNext() at System.Data.DataTableExtensions.LoadTableFromEnumerable[T](IEnumerable1 source,
DataTable table,
Nullable1 options, FillErrorEventHandler errorHandler) at System.Data.DataTableExtensions.CopyToDataTable[T](IEnumerable1 source)
at lambda_method(Closure ,
ActivityContext )
at Microsoft.VisualBasic.Activities.VisualBasicValue1.Execute(CodeActivityContext context) at System.Activities.CodeActivity1.InternalExecuteInResolutionContext(CodeActivityContext context)
at System.Activities.Runtime.ActivityExecutor.ExecuteInResolutionContext[T](ActivityInstance parentInstance,
Activity1 expressionActivity) at System.Activities.InArgument1.TryPopulateValue(LocationEnvironment targetEnvironment,
ActivityInstance activityInstance,
ActivityExecutor executor)
at System.Activities.RuntimeArgument.TryPopulateValue(LocationEnvironment targetEnvironment,
ActivityInstance targetActivityInstance,
ActivityExecutor executor,
Object argumentValueOverride,
Location resultLocation,
Boolean skipFastPath)
at System.Activities.ActivityInstance.InternalTryPopulateArgumentValueOrScheduleExpression(RuntimeArgument argument,
Int32 nextArgumentIndex,
ActivityExecutor executor,
IDictionary2 argumentValueOverrides, Location resultLocation, Boolean isDynamicUpdate) at System.Activities.ActivityInstance.ResolveArguments(ActivityExecutor executor, IDictionary2 argumentValueOverrides,
Location resultLocation,
Int32 startIndex)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor,
BookmarkManager bookmarkManager,
Location resultLocation)

Hi @SAMANTA_COTTACKAL1 ,

(From d In dtPortalExtractData.AsEnumerable
 Let status = If(Convert.ToBoolean(d("suspended")), "Terminated", "Active")
 Let ra = d.ItemArray.Append(status).ToArray
 Select r = dtTemp.Rows.Add(ra)).CopyToDataTable

Use this above expression, For instance, replace d(4) with d("suspended") if the column is named “suspended”.

Thanks,
Vinit Mhatre

Hi @Vinit_Mhatre ,

I will try this and let you know.

@SAMANTA_COTTACKAL1

Try to change you system packages looks like a package issue

cheers

Hi @Anil_G ,

Could you explain it? I dint get you.

Hi @SAMANTA_COTTACKAL1

System.InvalidOperationException exception occurs if the robot is unable convert or for any operation failure.

please check if value passed to the conversion is valid.

you can also include this assign activity in the try catch block for exception handling and passing it to the next row to identify the exact cause for the failure.

Cheers

@SAMANTA_COTTACKAL1

Go to manage pckages…upgrade or downgrade the UiPath.system.activities pckage and try agai
Cheers

Hi Team,

I would like to raise this concern again. As suggested by @Anil_G and @Vinit_Mhatre , I have done the required fixes. The bot was working for a while. Now again the issue is there.

  1. Status: calculated using the formula: =if(E2,“Terminated”,“Active”)
  2. License Type: calculated using the formula:
    =IF(ISBLANK(N2),“Free”,N2)

(From d In dtPortalExtractData.AsEnumerable
Let status = If(Convert.ToBoolean(d(“suspended”)), “Terminated”, “Active”)
Let licenseType = If(Convert.IsDBNull(d(“LicensesDisplay”)) OrElse String.IsNullOrWhiteSpace(d(“LicensesDisplay”).ToString()), “Free”, d(“LicensesDisplay”).ToString())
Let ra = d.ItemArray.Append(status).Append(licensetype).ToArray
Select r = dtTemp.Rows.Add(ra)).CopyToDataTable()

Hi @SAMANTA_COTTACKAL1

Can you try this query:

(From d In dtPortalExtractData.AsEnumerable()
 Let status = If(Convert.ToBoolean(d("suspended")), "Terminated", "Active")
 Let licenseType = If(Convert.IsDBNull(d("LicensesDisplay")) OrElse String.IsNullOrWhiteSpace(d("LicensesDisplay").ToString()), "Free", d("LicensesDisplay").ToString())
 Let ra = d.ItemArray.Append(status).Append(licenseType).ToArray()
 Select r = dtTemp.Rows.Add(ra)).CopyToDataTable()

Regards

Hi @vrdabberu ,

If I am right, the change has been brought in the licenseType rather than licensetype right?

This was already tried.

@SAMANTA_COTTACKAL1

Did you check whether LicensesDisplay column name has any spaces at last. Specify what are you trying to do.

Regards

Hi @vrdabberu ,

PFB.

@SAMANTA_COTTACKAL1

Try copying the LicensesDisplay column name from Excel and pasting it in the linq query.

Regards

@SAMANTA_COTTACKAL1

May I know what error are you getting?

Is it the same error again?

Cheers