I import some data into my sheet using this script https://gist.github.com/paulgambill/cacd19da95a1421d3164 as JSON import is not supported natively
=ImportJSON("https://example.com/my-data?format=json")
The data is imported correctly and I can see it in my table.
I want to create a filter on this table to sort/filter columns.
But when I, for example, try to sort it in ascending order it doesn’t work.
It kind of sorts it for a second but then it just returns to the initial state (I suppose it’s because the importJSON
function is taking over).
I tried copying the data to another sheet using
=ArrayFormula(Sheet1!A:F)
and ={Sheet1!A:F}
formulas and sort it there, but it behaves the same.
upd. Also tried referencing the individual cells like =Indirect("Sheet1!$E"&ROW())
How to achieve the correct function for the filter feature in this case?
you cannot manually sort an array generated by a formula. You have two options: turn the array into a collection of single values using
INDEX
or use theQUERY
function to do the sorting/filtering.I made it work with
INDEX
, thanks.