How to retrieve specific column value in string format through google sheets API?

Viewed 324

We have multiple columns in our google excel sheet as below,

image1

We are trying following API call,

https://sheets.googleapis.com/v4/spreadsheets/7dj1kU54fgrhQk46uMrqq-W-QMlBq45kjiuEdhfjm5zE5gNvUoLk/values/'sheet1'!A2:O200?dateTimeRenderOption=SERIAL_NUMBER&valueRenderOption=UNFORMATTED_VALUE&majorDimension=ROWS

By hitting the above call, we get the output as below,

image2

But, we want the value of column Currency same as available in the sheet. That is $667 where as we just get 667 by the above API call.

If we just replace the value of valueRenderOption with FORMATTED_VALUE, we get the output as below,

image3

But, then it returns the value of all columns as formatted. We just want to get the value particular column as FORMATTED_VALUE. Is there any by which we can do this?

1 Answers

Unfortunately not - you need to make two API calls if you want different cells to have different ValueRenderOptions. This is a limitation of the API itself, as the specified ValueRenderOption must be the same for the whole range in a single call.

Related