Cannot access DATASET via php

$session->getVariable( "DATASET" ) allways returns null.
If I try to get a specific variable thats defined in the extractor pattern, I get that no problem.
In the scrapable file, I checked "automatically save the dataset generated in a session variable..". I also checked "save in session variable" for each token.

I can't seem to find a description of global type variables, so is "DATASET" not the correct spelling, capitalization etc?

Thank you

Chris

Cannot access DATASET via php

Hi Chris,

Thanks, yes, that does clarify. So for each row in your DataSet you need to add a value indicating from which server that row originated, if I understand correctly. To do that I would recommend creating a script that would look like this:


dataRecord.put( "SERVER", "server1" );

This script should get invoked after each pattern application for the extractor pattern that pulls out the data you're interested in. The effect will be to add a value (called "SERVER") to the current row in the DataSet, since the dataRecord object will correspond to the row that was just extracted. If that still seems a little fuzzy you might glance over the "Variable scope" section on this page: http://www.screen-scraper.com/support/docs/using_scripts.php . And, as always, don't hesitate to post back if I can clarify.

Best,

Todd

Cannot access DATASET via php

Is the data you're wanting to add to the DataSet another DataSet? Or are they individual session variables? You've likely already discovered this, but if you select the checkbox indicating that you want screen-scraper to automatically save extracted data in session variables it will automatically append the data to the existing DataSet. If you want to add individual values, though, the technique will be a bit different. Could you give a few more details on what values you'd like to add to which DataSet(s)?

Thanks,

Todd

Cannot access DATASET via php

Hi Chris,

Is the extractor pattern associated with the DataSet you're wanting to pull also called "DATASET"? Remember that when you check the box indicating that you want to store the extracted DataSet in a session variable it creates a session variable using the name of the extractor pattern. That is, if you named your extractor pattern "EXTRACTED_DATA" you would request the DataSet like this:


$session->getVariable( "EXTRACTED_DATA" );

Hopefully that resolves the issue. If not, please feel free to reply back.

Kind regards,

Todd Wilson