You need to sign in to do that
Don't have an account?
Rodolfo Noviski
Use Google API to read Excel file
Using the code below, following the tutorial available in the salesforce site.
xmldom.element oneSpreadSheet = feedWk.entries[0]; // expects one spreadsheet
// get a new feed listing the worksheets in oneSpreadSheet
GoogleData worksheetsFeed = service.getWorksheets( oneSpreadSheet );
// pick the first one to rename
GoogleData.Worksheet ws = new GoogleData.Worksheet( worksheetsFeed.entries[0] );
string cellFeedUrl = ws.getCellFeedUrl();
// specify range to avoid data overflow
GoogleData feed = service.getFeed( cellFeedUrl );
list<GoogleData.Cell> cells = ws.cellFactory( feed.entries );
for (GoogleData.Cell cel : cells )
{
cel.dump();
system.debug ( cel.title + ' ' + cel.content );
system.debug ( cel.id + ' ' +cel.row + ' ' + cel.col + ' ' + cel.edit );
}
I'm not able to get a response when you run this code block. More specifically this line:
// specify range to avoid data overflow
GoogleData feed = service.getFeed( cellFeedUrl );
list<GoogleData.Cell> cells = ws.cellFactory( feed.entries );
for (GoogleData.Cell cel : cells )
{
cel.dump();
system.debug ( cel.title + ' ' + cel.content );
system.debug ( cel.id + ' ' +cel.row + ' ' + cel.col + ' ' + cel.edit );
}
No returns me no message in the log, not of error but returns no value, and the spreadsheet has values to be returned
Has anyone had a similar experience? Could anyone help me?
thank you
xmldom.element oneSpreadSheet = feedWk.entries[0]; // expects one spreadsheet
// get a new feed listing the worksheets in oneSpreadSheet
GoogleData worksheetsFeed = service.getWorksheets( oneSpreadSheet );
// pick the first one to rename
GoogleData.Worksheet ws = new GoogleData.Worksheet( worksheetsFeed.entries[0] );
string cellFeedUrl = ws.getCellFeedUrl();
// specify range to avoid data overflow
GoogleData feed = service.getFeed( cellFeedUrl );
list<GoogleData.Cell> cells = ws.cellFactory( feed.entries );
for (GoogleData.Cell cel : cells )
{
cel.dump();
system.debug ( cel.title + ' ' + cel.content );
system.debug ( cel.id + ' ' +cel.row + ' ' + cel.col + ' ' + cel.edit );
}
I'm not able to get a response when you run this code block. More specifically this line:
// specify range to avoid data overflow
GoogleData feed = service.getFeed( cellFeedUrl );
list<GoogleData.Cell> cells = ws.cellFactory( feed.entries );
for (GoogleData.Cell cel : cells )
{
cel.dump();
system.debug ( cel.title + ' ' + cel.content );
system.debug ( cel.id + ' ' +cel.row + ' ' + cel.col + ' ' + cel.edit );
}
No returns me no message in the log, not of error but returns no value, and the spreadsheet has values to be returned
Has anyone had a similar experience? Could anyone help me?
thank you