Would like to check whether is it possible to extract the account no values(excluding special characters that are not numeric or alphabets)?
Currently, i am working on a workflow to extract all the Accounts No if Column F is “Yes”, therefore if string equals to 1.14407922&1.14535051, i need the bot to extract the 2 account nos: 1.14407922 and 1.14535051 and then pass through a loop afterwards…
@Gokul001 , @Anil_G@ashwin.ashok ,@ppr thanks for the help, the regex expression works perfectly! Much appreciated. is there a dynamic way to insert Assign activity? Because, there are cases whereby there will be more than 2 accounts
Hi @Gokul001 , your XAML works perfectly but I would need to insert more than 2 variables to cater for the number of accounts no. There are chances whereby there will be more than 2 accounts provided.
System.Text.RegularExpressions.Regex.Matches(“1.12345678/2.35548674”,“\d+.\d+”)
[/quote]
and changed my variable to MatchCollection.
somehow this error popped up
RemoteException wrapping System.InvalidOperationException: Can not assign ‘System.Text.RegularExpressions.Regex.Matches(“1.12345678/2.35548674”,“\d+.\d+”)’ to ‘accts1’. —> RemoteException wrapping System.NotSupportedException: Expression Activity type 'VisualBasicValue1' requires compilation in order to run. Please ensure that the workflow has been compiled. at System.Activities.Expressions.CompiledExpressionInvoker.InvokeExpression(ActivityContext 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,
IDictionary`2 argumentValueOverrides,
Location resultLocation,
Int32 startIndex)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor,
BookmarkManager bookmarkManager,
Location resultLocation)
— End of inner exception stack trace —
at System.Activities.Statements.Throw.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 @Anil_G , an error pop up stating when i change acct1 variable to Match type, so in the end i have to change it to Match Collection.
i try writing a log message currentItem.value it says the value is not a member of MatchCollection.
i try changing it to currentItem.tostring it pop out this error message:
RemoteException wrapping System.InvalidCastException: Unable to cast object of type ‘System.Text.RegularExpressions.Match’ to type ‘System.Text.RegularExpressions.MatchCollection’.
at UiPath.Core.Activities.ForEachBase1.ContinueExecuting(NativeActivityContext context) at UiPath.Core.Activities.ForEachBase1.InternalExecute(NativeActivityContext context)
at UiPath.Core.Activities.ForEachBase`1.StartLoop(NativeActivityContext context)
at UiPath.Core.Activities.InterruptibleLoopBase.Execute(NativeActivityContext context)
at System.Activities.NativeActivity.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 @Anil_G , there is no errors but the account no are printing as follows after using the following regex expression: System.Text.RegularExpressions.Regex.Matches(“1.12345678/2.35548674”,“\d+.\d+”)
1.12345678
2.35548674
instead of printing the account no shown in the excel such as :
1.14407922
1.14535051
1.15523965
1.15523978
“1.12345678/2.35548674” this is the string that is being passed in the assign if you want to split what is there in excel then read the excel into datatable…run a for each loop and pass currentrow(“Youraccountnumbercolumnname”).Tostring