Facing Issue feeding the match data into excel

Hi, Facing issue while extraction the data and feeding into the particular excel row “C”

It’s starting writing from the C3 and when the loop iterates the second times it remove the C3 data overwrite the data in C3 cell. Can you plz help. @Palaniyappan

2 Likes

Hi buddy @balkishan
may i know what is the default value of Count
Kindly write cell if you are trying to write on a particular column row by row
Cheers @balkishan

1 Like

1 bro

1 Like

put the default as 2
and place the count assign activity next to write cell activity buddy @balkishan

1 Like

Now it’s not writing anything
image

2 Likes

@balkishan

use Write Cell activity instead of Write Range activity.

If your input data is DataTable then use ForEach Row activity but not ForEach loop.

2 Likes

fine i hope email is the output obtained from matches activity
–use a excel application scope and pass the file path as input
–inside this scope use a for each loop and mention the matches output
–inside the loop use a write cell activity where mention the range as “C”+Counter.ToString
where Counter is a variable of type int32 and default value of 2
and mention the item as input to write cell activity
–next to write cell activity use a assign activity like this
Counter = Counter + 1

Kindly try this and let know buddy
Cheers @balkishan

1 Like

May i know why add data row is used buddy,
are we trying to enter a row of values or just the email value from matches to the column email to the excel
Cheers @balkishan

1 Like

I got this error when I use Write Cell Activity. Bcz DT is a DataType variable.

2 Likes

Bro, I am using regex here so before the loop I create a Build Data Table and used Match Activity. Inside loop I am using the Add data row activity.

1 Like

@balkishan

Sorry i did not understand what you are trying here.

Could you please tell me what are you trying and also the steps you followed to do this. Then i can help you better in this.

2 Likes

Bro I am extracting email from the bulk text. So I have used Regex to filter the email only.
I have used Build Data Table and then Match activity. Inside the Loop I have used the Add Data Row
Below is the step I have followed. Basically I want to write the email address in the column C

2 Likes

Hi @balkishan,

can you explain your scenario in detail and share your Excel File. so, we can help you.

in Write Cell Activity you can give the String not the DataTable.

2 Likes

Fine @balkishan
i hope you have created a datatable with a column Email in it
–then used a match activity to get the value for the column Email
–then used a for each loop to add the value of matches into the datatable by means of add data row…
am i right…?

if so dont use write range within the for each loop, let the add data row add the value of matches to the column email in the build datatable and as the for each loop iterates, it will add all the values to the column to each row one by one
–next to for each loop use this write range workbook activity and mention the range as “”

Cheers @balkishan

1 Like

Bro string is not static it’s coming from the candidate profile.
Like this if you see there is email which I have to extract. This is diff in each profile. It’s extracting the correct email I’d from the text. Only the issue while writing into the excel column C.
image

1 Like

You’re right bro, but the above points I didn’t get.
image

2 Likes

Fine
is email address is the only column in it
Cheers @balkishan

1 Like

No bro I have total three column,
where in the 1st I am writing the Candidate name, second their Phone number and in column C I am writing the Email I’d.

For Name I am using the Data Scrapping and for Phone I am using the Get Full Text. But for Email Id these above method are not working so I am using Match - Regex.
For Name and Phone number no issue I am getting the correct value in the excel. But the issue with Email Id where I am writing into column C.

I used the String Manipulation for email I’d. But the array is not static. sometimes the index become 2 and sometime 3. So String manipulation is also not working there.

1 Like

if so kindly follow the below steps buddy
–use a build datatable activity and mention the column name and datatable name as DT…this is done, fine
–use a matches activity and get the values of email as a collection, this is done
–Then use a for each loop and pass the output variable of matches to it
–inside the for each loop use a add data row and mention the array row property as {yourcandidatevalue.ToString,yourPhonenumber.ToString,item.ToString}
–Now come out of the for each loop and use a write range activity where mention sheetname and range as “” and mention the datatable as DT, which has the added values of email because of add data row

Cheers @balkishan

1 Like

Hi @balkishan,

in your case do like below,

you said you already build datatable before for each loop.
After matches you want to add the email address to that datatable

then why you are using Add Data Row…?

use the code below…

  1. For each → iterate the Matches activity output.
  2. Create one Integer variable(counter) with initial value = 2
  3. use write cell value → in cell reference give like this “C”+counter.tostring → in value place give the item
  4. use assign acitivity to increment

2 Likes