Hi team, how to put all data in data table for various for different for each activities

This is my scenario

  1. i extracted data using regex
  2. using For each iterated.
  3. Each time i extracted various individual data like name, ref no, mobile etc.
    Now i have to put in data tabel. pls give me solution.tq

Hi @lakshminarayana_chavala ,

If you are already receiving the extraction properly, then the next steps for adding to the Datatable is preparation and Adding values to the Datatable. This can be done by using the Build Datatable Activity and the Add Data Row Activity.

  1. Use Build Datatable activity at the beginning and create the necessary columns in it (Keep the Column type as Object). Assign/Create the Datatable to it.

  2. Next inside the For Each After Each row extraction, we can use that data to add to the Datatable using Add Data Row Activity. Just specify the datatable to which the data needs to be added and in ArrayRow property add the values enclosed in curly brackets.

{name,refNo,Mobile}
  1. If needed, At the end after the For Each Activity use a Write Range activity and write the datatable to an excel sheet.

Let us know if you were able to follow the above approach.

Actually my scenario is

I am using one For each for guest name
One For each for Refno.
One For each for mobile

Like that i am using 3 For each to extract various data.

Now where i need to place data table and add data row?

@lakshminarayana_chavala ,

In that case, maybe we need to take a look into your Data/Sample data and the regex that you have used.

If the relation between the values (RefNo, Mobile, Guest Name) is co-related, then using 3 regex for three values is not a recommended.

We can maybe check if we can extract the values as a single row, so that it is co-related and we can add the values to the datatable accordingly.

Hi

I guess this is what you are looking for

Strings.xaml (16.7 KB)

mostly the same scenario i guess

Regards

Hi, your guess is correct. but i am get that data from pdf. one of the activity is missing in your workflow.
image

Hi @LAKSHMI_NARAYANA_PEMMASAN can u provide missing activity info

it it matchs activity to get matchs from the string


Room.+[\s\n|\r]Guest.+[\s\n|\r]Nights.+[\s\n|\r]Hotel Ref.+[\s\n|\r]Commission.+(?=Std)
expression used in it

this was for other post , in same post Yoichi gave a better solution you can that as well https://forum.uipath.com/t/hi-team-pls-provide-regular-expression-for-the-data-tq/531373/8
Regards

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.