How to Search and edit text in textarea

Hi,
I have a text like…

We have wrapped the tags for {INSERT} and have attached them to this email.
Please review and let us know if anything needs to be changed.

Here i need to search for INSERT string and replace it by someother string.

Hi @kavyashree.sundar
We can do this multiple ways but i think the easiest way is using string manipulation.
for this Follow the following steps.

  • store your string in string variable as Str .
  • Use Str.Split(cchar("{"))(1).Substring(1,6) and store this in String variable.
    this way you will get INSERT.
    Thanks & regards

Hi @kavyashree.sundar

Here is what you can do:

  1. Use Get Text activity to get the value from the textarea. Let’s say the variable name is strText
  2. Use Assign. strText = strText.Replace(“INSERT”, “Your text here”) to replace the INSERT word with what you want to replace.
  3. Use Type Into activity to type it back to the textarea.

Thanks and regards.

4 Likes

thank you,

but here while doing type into, it is typing in single line, it is not in the format as it was before.

how to type in format

Can you show a screenshot?

3 Likes

Hi @kavyashree.sundar

A normal string would usually show up in a email as a straight single line. No formatting will be there.

In order to have formatting and nice paragraph and bullet points, you need to wrap the string inside html tags. This is required for email bodies.

Follow the below steps.

  1. Find a online free html editor where it allows you to type normal next in the required format and it will generate the html code for it.
  2. Get the html code and save it as it is in a notepad text file. This should also include your {INSERT} to add the values later.
  3. Read the text file onto a string variable
  4. Use string formatting and add the data you need for INSERT part. Here, if you need to add data as bullet points or on in different rows, again make sure to add it along with the required html tags to maintain the format…
  5. Now add it to the email sending activity and it will have the required format :slight_smile:
2 Likes

I has been completed the task.

Hello XYZ,

Your request is now completed.

User Name: ABCD
Company Name: PQRS

We have wrapped the item for {INSERT} and have attached them to this file.

Please review and let us know if anything needs to be changed.

Best,
Team

ref:00000000000000000:ref



This the format, here i need to replace the insert string with some other string thats it. but format should be the same.