ImportJSON icon indicating copy to clipboard operation
ImportJSON copied to clipboard

Data queries not importing in order requested

Open rbettendorf opened this issue 5 years ago • 4 comments

Hi everyone - I have a feed I monitor and pull in that represents a TV schedule. I have been following this issues thread (https://github.com/bradjasper/ImportJSON/issues/107) in order to learn the proper syntax for pulling in data fields in a specific order - it's been a great resource. But I am having an issue where the import script is not pulling the fields in the order I am requesting, and need some help.

The feed I use is here: http://prod.gatekeeper.us-abc.symphony.edgedatg.go.com/schedules/networks/001?startTime=2019-03-30&endTime=2019-04-06&deviceId=001Accept:application/json

where start time and end time can be modified to represent a 30-day range, or something shorter. I am importing that JSON from sheets, found here: https://docs.google.com/spreadsheets/d/1uQnYGR81onRuJJIMnOYTmGdxuQ4iL87Jy38tz-z8tzY/edit?usp=sharing

The call is in A2, and what I have done in row one is capture where in the call I am requesting that piece of data, e.g. ColA/ColB holds data that is the 13th requested data point in the call. From Row 1 you can see the data comes in very much out of order. I have tried all manner of combinations to the noInherit, noTruncate query to no avail. Any other ideas? Thanks!

rbettendorf avatar Mar 29 '19 01:03 rbettendorf

Check out this solved issue #120. I tried it and it works for me.

zem360 avatar Jul 30 '19 15:07 zem360

The "allHeaders" solution did not work for me, unfortunately.

What DID work for me - and I'll leave here for reference should anyone come up against a similar issue: Create a second sheet; in that second sheet in each column you want to extract from the importjson data originally returned, use the HLOOKUP function to return the complete column containing the name of your header title. That has worked consistently, no mater how much the source data on the sheet using the importjson gets.

rbettendorf avatar Sep 04 '19 21:09 rbettendorf

I'm using "allHeaders" and "=INDEX()" formule to hide the Headers with spreadsheet...

=INDEX(ImportJSON("http://myapi?params)=1";"/id,/title";"allHeaders");2)

Enjoyyyy

leooxx avatar May 18 '20 13:05 leooxx

The allHeaders solution is broken, and the above suggestions are inadequate hacks.

ciscorucinski avatar Sep 10 '20 08:09 ciscorucinski