Read each value in a column (for JavaScript users)

Here we will be posting premade Helium Scraper projects and helpful stuff.
Post Reply
webmaster
Site Admin
Posts: 494
Joined: Mon Dec 06, 2010 8:39 am
Contact:

Read each value in a column (for JavaScript users)

Post by webmaster » Thu Apr 07, 2011 8:40 pm

This project is meant for people who use a little JavaScript with Helium Scraper. It contains an actions tree called "Read Each Value" that when invoked from a "Execute Actions Tree" action, it will read each value from a column in a table (you must create the table first), store it in a given variable (such as "Global.UserData") and execute the child nodes of the "Execute Actions Tree" action that invokes it for each of the rows in the given table.

Note that you must set the variable to something inside "Global.UserData" or "Global.UserData" itself if you don't need the "Global.UserData" object for anything else.

If you would like to store the values into something like "Global.UserData.Value" so that you can use "Global.UserData" to store other stuff as well, you would need to initialize "Global.UserData" to a custom object such as in the following code:

Code: Select all

function GlobalData()
{
	this.Value = null;
}

Global.UserData = new GlobalData();
This code would need to be executed before the "Read Each Value" actions tree is invoked. I'm also attaching a sample project to illustrate this.
Attachments
ReadEachValueSample.hsp
(472.83 KiB) Downloaded 542 times
ReadEachValue.hsp
(471.28 KiB) Downloaded 497 times
Juan Soldi
The Helium Scraper Team

Post Reply