Dynamic text


#1

Hi All

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?

Kindly help me out with this

Appreciate your help :slight_smile:

Thank You
Pramila


#2

@pramilag, This one gives you an solution/idea,

Regards,
Dom :slight_smile:


#3

Thank you for the quick response @Dominic . :slight_smile:

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

Regards,
Pramila


#4

@pramilag
Since you are saying that before and post of naquick will remain same for even other letters,
You can also try like this

stra=Request to remove accounts for naqviz in FLEX Non-Prod environments

strb=stra.Split({" ",stringSplitOptions.RemoveEmptyEntries)(5).ToString will give you the output.

Regards,
Mahesh


#5

@pramilag,

Reference - The word(s) just before dynamically changing word
and Cahier - The word(s) just after dynamically changing word

In your case,

Reference = remove accounts for
Cahier = in FLEX Non-Prod environments

Regards,
Dom :slight_smile:


#6

Hi,

Thank you @MAHESH1 and @Dominic for your inputs at the earliest. :slight_smile:

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

seq1_12032018_naqviz.xaml (11.6 KB)


#7

@pramilag

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

Regards,
Mahesh


#8

Thank you so much @MAHESH1 for your active and quick responses.
Appreciate your help. :slight_smile:

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.

this is the whole body of the email
Or else can you please help me attaching any sample xaml file for reference which contains the 3 names
thank you :slight_smile:


#10

@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.

Regards,
Mahesh


#11

@MAHESH1

thank you so much for your input :slight_smile:

I have moved all the mails to a label and captured the body as input.

Its working fine now. :slight_smile:

Regards,
Pramila