qeet / IMPORTJSONAPI

Use JSONPath to selectively extract data from any JSON or GraphQL API directly into Google Sheets.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pass hyphen in column name?

ChrisLally opened this issue · comments

Is there a way to pass a hyphen in a column's name?

I added ["hyphen", /^-/] to the patterns list which didn't throw an error anymore, but did skip those columns. Any advice greatly appreciated!

commented

you can quote the column name with single quotes eg:

IMPORTJSONAPI("http:...", "$..", "'col-name-1'")

Worked like a charm! Thanks @qeet!!

I wonder if it's possible to do this automatically if a hyphen is detected in a column name?

Wow I got it!

Just need to add: if(input.includes("-")){var input = "'"+input+"'"} directly under function read_token_(input, i)