Dt1

Here i extracted the data from web page. So i am trying to write it into Excel but unable to write it. Is there anything wrong in the below code

Hi @Pushpendra_kowthavarapu

Can you please elaborate what’s the exact issue that you are facing here so that we can understand your requirements?

Best Regards.

Hi @Pushpendra_kowthavarapu
Remove the new object() in the array row of add data row activity and try

Hope it helps!!

Hi @Pushpendra_kowthavarapu

After extracting the datatable from the web browser it stored in a datatable datatype variable.
After that use write range workbook activity to write the data to excel directly.

No need to use the add data row activity.

Hope it helps!!

Hi @arjunshenoy ,

The thing is extracting 4 web elements from a web page individually. So when I want to write those elements in Excel , i need to create a data table right. So someone suggest me with the above code. But can’t able to write it .

Hi @mkankatala,
Here i am extracting the web elements individually like from different places.

@Pushpendra_kowthavarapu

Well, in that case, you can directly pass the values in the ArrayRows field without actually creating a new object for the same. You can try {value1, value2, value, value4} & the sea data should be reflecting the data table that you built.

image

Hope this helps,
Best Regards.

@Pushpendra_kowthavarapu

Can you please tell if you are getting any error…if ao what is that and on which activity you are getting it

Cheers


It is the throwing the error like this.

@Pushpendra_kowthavarapu ,
Please check whether the str_output variable has data after the add data row activity.
If it is there can you please remove that “A1” in your write range workbook activity and keep it blank and check?

Regards,

Hi @Anil_G ,

Here i am not getting any error. But the thing is unable to write it in the Excel file.Below is the code i have written.

@Pushpendra_kowthavarapu

Can you please do step into and check if the datatable is getting created properly

Cheers

Okay then create a Datatable by using Build Datatable.
After extracting all data store it into a variable. Use the Add Data row Activity to add each variable data to the Each column. In Array row option in the add data row activity give the variables there by encapsulating with Curly braces like this -
{Variable,Variable2,Variable3}

Hope it helps!!

Here you are doing one wrong step. Above the Open application/Browser activity only create the datatable with Build datatable.

You have given after extraction of values from browser right, In this case the datatable will create for every time and data is override in the datatable and excel file.

Hope it helps!!

Hello @Pushpendra_kowthavarapu, try using the “Write DataTable to Excel” let me know if it worked. :slight_smile:

Thanks bro, Now its working fine.

Its working now. Thanks for the reply.

1 Like

Now it’s working bro. Thanks a lot for the information.

1 Like

@Pushpendra_kowthavarapu

Happy Automation

Cheers

@Pushpendra_kowthavarapu If you find the solution for your issue. Mark as solution to close the loop.