I am trying to retrieve a dynamic text from a string
for eg : Request to remove accounts for naqviz in FLEX Non-Prod environments
In the above string the name naqviz is not static but the remaining string(post and before naqviz) is always the same.
I can receive some other mail requesting to remove account for some other user say joseph
I am using regex to retrieve naqviz but its just confined to a static text.
How can I achieve the dynamic values(joseph and naqviz here) and save it in an array variable for further use?
I have used regex for obtaining the value but what if I want to get the dynamic values
As per your solution, I suppose for a string which is given as input we will perform regex on the same but it doesnot give me multiple values.
And it will be really great if you could help me by attaching the text file because in the regex am not able to figure out what is REFERENCE and CAHIER
Thank you @MAHESH1 and @Dominic for your inputs at the earliest.
Please find as attached my xaml file.
Currently am doing the same as suggested by you
But my concern is I don’t want to store the string in a variable.
If that is the case then I can easily retrieve it by performing string manipulation.
Please do have a look at my scenario:
I will receive mails from service desk having the body as Request to remove accounts for (some name) in FLEX Non-Prod environments
Lets assume there are 3 mails triggered asking to remove the accounts for
naqviz , joseph , john
So I have to apply a condition now : if mail.body contains even a string as request to remove accounts for (any name) in FLEX Non-Prod environments then perform the regex operation and retrieve the values naqviz , joseph , john in an array variable
Note : If I use the given statement(i.e.Request to remove accounts for naqviz in FLEX Non-Prod environments) as is in the if condition then it will not look for the other names except naqviz.
So now my ques is : Do I have any option such as wildcard character which can replace the names ? so that I can loop through my mail box and search for the 3 mails which contains the subject Request to remove accounts for ****** in FLEX Non-Prod environments
You no need to store it in a string variable.
what ever you are doing now that’s correct only
Create one list of strings for the names which we have to remove. lets Take ListA
Inside foreach of the mail messages and inside if condition
use matches activity. Inside Input Property give item.Body
if the count of the Matched array is Greater than zero then Use Add Collections Activity
and matchValue(0).Value to the Collections.
At last Your collections will contain only the names which you want to remove
Thank you so much @MAHESH1 for your active and quick responses.
Appreciate your help.
what am I supposed to give as input in the matches activity
I have to give the whole string right?
then only it will perform operation on the input string containing the naqviz name
Input property I cant give item.body because body contains more details apart from the above statement.
@pramilag
try once by giving item.body. if its not working then we have to split it based on new line and then for every line we have to apply match activity.