If IsMatch, then wirte in Data Table

Hello all,
I have a bot that extracts RegEx expressions from a mail. A special feature is that one of these RegEx values does not always occur, which is why I have integrated the IsMatch activity. Now I would like it to enter an “x” in the correct column of the table if IF is true.
Who can help me with this? IsMatch

Hi,

Perhaps you should use Matches activity instead of IsMatch Activity. It returns IEnumerable<Match> type.

Then condition of IF activity will be ZUEB.Count>0

Regards,

That works so far, thanks, the problem now is that it doesn’t want to write the entry in the table, what’s the reason for that? FM1
FM2

dtOutput.rows(intIndex).Item(row.Item(“ZUEB”).ToString)

Hi,

This exception means there is no column named “ZUEB” in database which is assigned ForEachRow. Can you check it?

Regards,

There is a Column with this name, i dont no what is the Problem. All other value write the Bot in this Data Table.

Hi,

Can you share your workflow and data? We cannot check it only from the above information.

Regards,

Hi!

After RegEx try to store the data in a variable(String) and then use Generate DataTable which will take the input as a String and result will be stored in DataTable.

Then use Write Cell or Write Range according to your requirements.

I hope this will works for you

Thanks & Regards
NaNi

Hi, here is my xaml which is not working properly. The problem is that the RegEx ZUEB is not always present and I can therefore only write it in the table if it was in the mail. Main.xaml (16.8 KB)

Hi,

Can you try the following expression? Perhaps it should be not ZUEB but Regex?

dtOutput.rows(intIndex).Item(row.Item("Regex").ToString)

Regards,

I have tried this and get the following message
FM3

Hi,

Can you share detailed information of the exception? We can see it from $ExceptionDetails at Locals Panel when error occurs in debug mode.

Regards,

you need This!?

RemoteException wrapping System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. —> RemoteException wrapping System.ArgumentException: Column ‘\b(38\d
{
7
})\b’ does not belong to table TableName.
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,

Thank you for sharing. It means there is no column named \b{38\d{7})\b

Although I might not understand your requirement correctly, how about the following?

dtOutput.rows(intIndex).Item("ZUEB")

If it doesn’t work as you want, can you explain what you expect in the expression?

Regards,

You understood the requirement correctly and your solution works exactly as I imagined, thank you very much!

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