Question

save web data to a separate Excel file

  • 14 February 2024
  • 18 replies
  • 172 views

Badge +3

which Automation Anywhere Actions can I use to save my web output data to a separate Excel sheet instead of my Input Excel file?


18 replies

Userlevel 3
Badge +5

Write from datatable if web data is in table format 

Set cell action if your data is string/number format 

Badge +3

In the given scenario, I possess an input Excel file containing various CNIC numbers. Corresponding to these CNIC numbers, I intend to extract data from a NECTA website where the required information is presented in a web data table format. I have implemented the 'set cell' command to organize the extracted data, intending to save the ID in Column B, Name in Column C, and Father's name in Column D. However, upon successful execution of the bot, the extracted data associated with CNICs is currently being saved directly into my input Excel file. My objective is to have this output web data saved in a separate Excel sheet. To achieve this, what action or approach should I employ?

Userlevel 3
Badge +5

Use Swift to sheet action by mentioning the name of the sheet 

Then countinue your adding details process on that sheet

Badge +3

thank you for helping me out but i want to save my output in a separate workbook/Excel File, not a separate worksheet, which action should i use ?

 

Userlevel 3
Badge +5

thank you for helping me out but i want to save my output in a separate workbook/Excel File, not a separate worksheet, which action should i use ?

 

Use file action 

File -> create action 

 

Then give path example:- c/user/ exfile.xlsx

Userlevel 3
Badge +5

You can also use create workbook action in excel package

Note:- make different session names while using two excel workbooks in excel actions

Badge +3

its not working. Is there any Excel Advanced Action for this purpose?

Badge +3

yes i used this but it was not working ‘the create Workbook’ Action

Badge +3

which action should i use if my output is stored in a record variable and i want to save it in a different Excel sheet

Userlevel 4
Badge +6

You can create a Data Table variable and use the Insert row action to add a record to the table. Once in the table, you can write the table to an Excel document.

You mentioned the “Create workbook” action was not working for you. What was the error? Do you have Excel installed (that is a requirement)?

By the way: Do not use File: Create file to create an Excel file. A “blank” Excel file actually contains 7kB of data.

Badge +3

to write the table to an excel document which command should i use?

 

Badge +3

This is my bot, and it is currently functioning properly. However, it is saving the web output data in the input file. I want it to save this web output data in a separate Excel file. What action should I use for this, and where should I implement it?

 

Userlevel 4
Badge +6

You would add an Excel advanced: Create workbook with a different session name from your input file.  You can add it right after your Excel advanced: Open.

After the loop, add an Excel advanced: Write from data table. Be sure and use the new session name. This will write the entire table to the new Excel file.

Remember to save and close the files.

Badge +3

Thank you so much for helping me out. 

The output variables I assigned are of string type, but the Excel Advanced Write from DataTable action requires a Table variable. What could be a possible solution for this?

Userlevel 4
Badge +6

If you have string values, then use the “Set cell” actions. Don’t use Write to Table unless you already have your data in a table.

Take a look at this best practices guide. Even though it seems wordy, the Set cell and Go to cell actions used in conjunction are easy to use, easy to manipulate, and easy to debug.

Badge +3

@Aaron.Gleason thank you so much for the help 

Badge +3

My bot is writing data to both the input and output Excel files. Although I have used the read-only argument in the Excel advanced open command, data is still being written to the input file. I only want data to be written to the output Excel file.

Userlevel 4
Badge +6

Make sure you’re using the correct session name. Your input and output files, when you open or create them, have a name associated with them. If you’re using the wrong session name (e.g., the input session name when writing to the file), the output will go to the wrong file.

Reply