Can anyone in this forum help me solve this problem?
I would like to store some data on the website and save them as variables. Then, reuse the variables as well as save those variables in the excel file.
My plan is to use data scraping. But how can I save each piece of information as variable?
Then, in your data scraping activities there should be a place to put an output variable. Depending on how you’re scraping it may be called Value or Text. Put the variables in here and then they will have the value of the scraped data.
When you run the Data Scraping wizard it should generate a table with the results in it.
Then you can use a Write Range activity inside of an Excel Scope to write the scraped contents to an excel file. If there is any other data that isn’t automatically scraped by the wizard then you’ll need to manually scrape that and then place it into the corresponding entry in the datatable.
Let’s say you want to set the first column of the first row to “A”. You can say ExtractDataTable(0)(0) = “A”. Just substitute “A” with your variable. If you need to add a row to the table you can do so with the Add Data Row activity.
If it’s giving you a DataTable output you can either:
a) merge the output table with yours to preserve records that are in your table
b) overwrite your table with the output
Just a recap, We use the Data Scraping with the output set to variable, then use Built Data Table with Add Data Row in the DataRow field add variables?
Yes, if you use the Extract Structured Data activity it will give you a variable with type DataTable. If that variable is the same as the table you created with Build Data Table then the data that was extracted will overwrite the variable. If it is a different variable than the one you built you can use Merge Data Table to join the tables, but the number and variable types of the columns must match up.
Alternatively, if you are NOT using the Extract Structured Data activity and you just have values stored in variables you can use the Add Data Row activity to add the data manually to your table. To do this it must be either an ArrayRow or a DataRow. To make it an ArrayRow you can type {var1,var2,var3} where var1, etc are your variables.
I’ve attached a workflow with two examples. The first one uses the data scraping wizard to get data and then writes it to excel. The second one uses the Get text activity to scrape some values, store them as variables, add them to a datatable, and then write it to excel.