Return value from the read function

Per the docs: Return Value The last part of the key of the data value to be retrieved.

Outputting of the key name isn’t particularly useful in some cases. For example, when reading a specific array item like I have:
“time”: “2021-08-25T13:29:47.2”,“vals”:[14.44,9.01,15.34,10.09,14.3,35.47]},

In which case, what gets output is “0”, “1”, … This results in me having to hide the read function somewhere as this info isn’t particularly useful.

I think it might be helpful to have optional argument which lets the user select what text appears.

jrd

Hi jrd,

You are right, arrays are automatically assigned a number.
Is the reason for you to want to hide/“change the key” the appearance on the sheet? Because you want to create a dashboard? Or why would you want to do this?

Cheers,

Tizian

Basically, I just want the function to make a table header line. Now, I would need one cell to get the data, one cell for the header and one cell for the data to make the data ‘presentable’. Since the cell that gets the data isn’t outputting anything useful/understandable when grabbing data from an array and thus, effectively needs to be hidden and/or made less obtrusive, I figure why not have the cell that returns the data return some appropriate header text…

I understand. There is basically a lot of overhead, which could be reduced. :slight_smile:

One thing you could do right now is using the READ() function and pointing the Target Cell parameter to your table. You still would have the problem with the READ() value being 0 and in a way redundant.
For now, you could use 2 sheets to hide the READ()s and build up logic parts and the second one to display your results in a cleaner fashion.

Planned for the upcoming version is a feature, which will help you completely avoid this problem. We will add a DOT notation feature. It will be possible to access JSON elements directly via a reference.
An example for your use case:

=INBOXDATA."vals"."0" would then result in 14.