Add all fields in the item response instead of only existing fields
AnsweredSince item fields are not nesessarily filled with data, when I request an item, it only returns an array of itemfields. But it is not possible to show all fields with the item-information.
I often put the item external_id's in an object with keys for easy reference in my scripts. But, when I loop through the array I don't get all external Id's, and that is where I always have to check if the external id exists.
It can be solved by getting the Application data but then I always have to do two calls.
So...
Would it be hard to include the non-used fields?
-
Including all fields is a waste in most cases (e.g. any case where you are working on more than 1 item from the same app). So fetching the app is the way to go in most cases. If you're always working on the same apps and the structure doesn't change you can also store the app structure in a cache so you never have to fetch it again.
You should be able to get the app structure returned by using the
fields
query parameter to tell the API what data you want returned. It's undocumented at the moment, but the basic idea is that instead of making a request to/item/{item_id}
you make it to/item/{item_id}?fields=app.view(full)
Please sign in to leave a comment.
Comments
2 comments