hello,
i have below kind of errors
Cannot add user. ‘ABC’ does not exist, user is already a member of ‘Test_abc’ group
Cannot add user. ‘PQR’ does not exist
i only need value ABC and PQR from whole string.
“Cannot add user.” this is constant for each error.
help me on same to get only those values
Ajay_Mishra
(Ajay Mahendra Mishra)
December 3, 2024, 12:01pm
2
@Mathkar_kunal Share dummy string value, if possible and expected output!
i have entioned
same like below one by on e error i am getting in loop
error 1] Cannot add user. ‘ABC’ does not exist, user is already a member of ‘Test_abc’ group
error 2] Cannot add user. ‘PQR’ does not exist
expected output
1] ABC
2] PQR
lrtetala
(Lakshman Reddy)
December 3, 2024, 12:05pm
4
Hi @Mathkar_kunal
Try this
(?<=Cannot\s*add\s*user\.\s*‘)(\w+)
Or
(?<=Cannot\s*add\s*user.*)([A-Z]+)
System.Text.RegularExpressions.Regex.Match(Input,"(?<=Cannot\s*add\s*user.*)([A-Z]+)").Value
Regards,
ppr
(Peter Preuss)
December 3, 2024, 12:06pm
5
(?<=Cannot add user. ['‘]).*?(?=['’])
we cannot rely on inverted single quotes like ‘ as it could be a copy paste issue but can handle defensive it
Ajay_Mishra
(Ajay Mahendra Mishra)
December 3, 2024, 12:18pm
6
Okay @Mathkar_kunal
You are iterating through each string and you are getting error like: User does not exist.
Just create a empty list above your loop
myList = New List(Of String())
and put a try catch in for each activity in try block put all your activities, and in catch block use Append Item to Collection Activity.
At the end you will get all the Users which will throw an error!
Best regards,
Ajay Mishra
tried not working for Cannot add user. ‘ABC’ does not exist, user is already a member of ‘Test_abc’ group (giving output as T)this but worked for Cannot add user. ‘PQR’ does not exist
error 1] and error 2] i have added for understanding please dont consider that and it is not likke each user contains only 3 letters like abc it may differ like abcd or fdsfss
ppr
(Peter Preuss)
December 3, 2024, 12:49pm
8
Mathkar_kunal:
tried not working
unfortunately feedback is not clear. please rephrase and let us know in detail
what was done
what is failling
used sample data
Thanks
i have below kind of errors in loop one by one (errors are copied from webpage using extract data table)
Cannot add user. ‘ABC’ does not exist, user is already a member of ‘Test_abc’ group
Cannot add user. ‘PQRJYF’ does not exist
Cannot add user. ‘PQRD’ does not exist
need output like below
ABC
PQRJYF
PQRD
ppr
(Peter Preuss)
December 3, 2024, 12:55pm
10
Pattern from above looks good:
also have a look here:
[CheatSheet] - System.Text.RegularExpressions | RegEx - News / Tutorials - UiPath Community Forum
[HowTo] LINQ (VB.Net) Learning Catalogue - Help / Something Else - UiPath Community Forum
This HowTo gives an introductory overview of the conjunction operators: Concat, Append, Prepend
Introduction
The conjunction operators are used to add the item(s) to a particular set of items.
Concat, Append, Prepend Operator
The Concat Operator combines a set of items with another set of items
The Append Operator adds an item to a set of items on the end
The Prepend Operator adds an item to a set of items on the begin
Overview
I – Input
P – Processing
O – Output
{"A","B"} / {"C",…
i am using same expression then why output is like this
ppr
(Peter Preuss)
December 3, 2024, 1:03pm
12
because you are using a toString / Message Box and it will not return the variable content but the datatype for this case. It is not a bug, it is the right behaviour from .Net.
inspections are done via debugging and e.g. debugging panels:
Understanding the 6 Debugging Panels of UiPath in the easiest way possible! - News / Tutorials - UiPath Community Forum
along e.g. with this statemtent:
String.Join(",", Result.Cast(Of Match).Select(Function (x) x.Value))
ok my bad one mistake from my end
Cannot add user ‘abc’, user is already a member of ‘Test_Sanjeer’ (“.” is not there after user in such errors when it contains extra line as “already member of”
give me revised expression
ppr
(Peter Preuss)
December 3, 2024, 1:14pm
14
its better to tell us all the samples and variations on the begin. Also, share text samples (SOP) always with us
(?<=Cannot add user\.? ['‘]).*?(?=['’])
system
(system)
Closed
December 6, 2024, 1:17pm
16
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.