Data Manipulation to extract the required data from a string in UiPath

Manipulating the data as per the requirement is the need of business and used in every project. There are vaious functions available in vb.net that helps us manipulate the data very easily as per our need like- Trim, Substring, Split, Replace, Remove and so on……

Let’s see the Implementation in UiPath

Example-1:-

  1. Drag an assign activity in the Designer panel. We will manipulate the InitialMessage value.

image

  1. We will split the above string to get the text before the full stop.
    image

  2. Use the message box to print the result.
    image

  3. We will further split this string to get the author name. We will use substring function and get the last index of author from the string which will return the string from the author.

  4. Use the message box to print the result.
    image

  5. Now, we need to trim the author from the string.

  6. Use the message box to print the result.
    image

Example-2:-

We need to extract the book names from the Initial Message.

  1. Drag an assign activity in the Designer panel. We will manipulate the InitialMessage value.
    image

  2. We will use a split function to split the string by full stop.
    image

  3. Use the message box to print the result.
    image

  4. We will further split the string by semicolon.
    image

  5. Use the message box to print the result.
    image

  6. We will now split the string by comma and convert it into Array.Here Books variable would be Array[string].

7.To print each value from an array , we will use the for loop and put the message to print the result.
image

  1. Run the workflow to check the result.
    image
    image
    image

I hope you enjoyed the article!
Happy Automation!!