row().Tostring to read from each row under same column


Excel “datatable1” with two columns and many rows :

Col A…Col B
Name … Paul
Gender …Male

Excel “datatable2” with two rows and many columns:
Row1/Col A (Name)…Col B(Gender)…Col C(Contact)
Row2/Paul… … … … Male… … . … …1234

I would like to “Read Range” from datatable, “For each Row” then “Anchor base” to “Find Element” and “Type Into” another master file.

Under the “Type into”, for datatable2, I can use row(0/1/2).ToString
If for datatable1 arrangement, how can I read from each rows from the same column?

I tried to use back the same row().tostring but it failed.

Please help. Thank you.

You need to pass the column index or column name to get the value from the data table @MrHeng

Hmm. sorry…
How to pass the column index/name?
Can you write the formula for me?

within the for each row , you can get the value using the column name or column index, lets say the column name is name and it is the first column in the datatable,

then row(“Name”).ToString or row(1).ToString will retrieve the value

Hi, I still can’t get it.

My datatable1 is like below:
Col A/Col B

My Form1 is sth like this:
Address: (empty)
Name: Paul
Contact: (empty)
Gender: Male

I am using “find element” & “type into”. I put row(1).tostring for searching the Name but it filled in my Form1 first cell “Address” with all info; which is incorrect.
Address: Paul Male 1234

Please help.

I want to fill in another form1, find correct description and fill in the blank. The form1 is something like:

The best solution for this is adding the colA and colB into a dictionary @MrHeng

  1. Read range activity and store in a data table
  2. Install the package Microsoft.Activities.Extensions
  3. You will get dictionary activities and declare and initialize the dictionary as new dictionary(of object, string) —> based on your requirement
  4. Loop the data table using for each row
  5. use add dictionary activity and give the key as row(“colA”).tostring and value as row(“colB”).tostring

Sorry . I am stupid. Can you attached sample script for me?

Heyy dude, here it is :slight_smile:

Just take it as reference and build your own , not at all a problem

Dictionary.xaml (7.0 KB)