google-spreadsheet-to-json icon indicating copy to clipboard operation
google-spreadsheet-to-json copied to clipboard

How to get spreadsheet that contains sheet id (gid)?

Open soutot opened this issue 7 years ago • 3 comments

Hi,

I have 2 spreadsheets that looks like this: https://docs.google.com/spreadsheets/d/1234abcd/pub?gid=0&single=true&output=xlsx https://docs.google.com/spreadsheets/d/1234abcd/pub?gid=09876&single=true&output=xlsx

How do I specify which spreadsheet from id 1234abcd I want to work with? I couldn't find any property like "worksheet_id", neither I was able to use the gid querystring in "spreadsheedId" property.

Thanks in advance

soutot avatar Mar 24 '17 16:03 soutot

Hey there,

You can use the worksheet option, passing the name or the index of the desired worksheet (-w or --worksheet in command-line).

bassarisse avatar Mar 27 '17 13:03 bassarisse

+1 for this feature: @bassarisse actually the "gid" is not working

const assets = await gsjson({
    spreadsheetId: '1WXQ4mmU0lKSIivxejPdrS7SHgxQCIxnJ8evVLWszuKs',
    worksheet: ['380908001'],
});      
Failure: Error: No worksheet found!

You did a great job with this repo!

damianobarbati avatar Oct 13 '17 10:10 damianobarbati

Sorry if I didn't make myself clear. Matching the worksheet by the "gid" is currently not supported, ony by name or index.

bassarisse avatar Oct 13 '17 18:10 bassarisse