How to get Header Labels in tablegrid from json

Hello,

When we write a Lookup() function in custom formula of a tablegrid , it extracts the coloumn headers and makes them as header lables.

If we pass a Json to the table grid, it doesnt do so. How can we ensure the json when represented on a table through a tablegrid, gets all the header labels.

I need this because.
I have a custom function, applied over a lookup. this function changes the output header structure.
So, if i directly apply the Function(lookup()) in a table grid, i get the correct output, but the lable headers are mismatch.

If I apply Function(lookup()) in a json datastore, and table grid points to this jsondatastore, I get the correct output, with correct headers, but, when i turn this table grid in selection mode, I am not able to extract data .

If the same table grid has correct labels , I am able to make selection work.

Since the header labels are dynamic, i cannot hardcode them.

any solution?

Any solution for this!

I need to select data from a row generated from dynamic table.

regards

Hello,

Just elaborating the issue

Dynamic Table Grid, input is a Jsonstore control. Here the size coloumns are dynamic.
number of size colomns and their names change.
image

If the jasonstaore is used in a textbox, following jason definition is displayed.

image

  1. Formula for Tablegrid. By default it has not picked up the Headers.
    image

  2. Formula for table grid, it has picked up the labels from the lookup function. Not the custom function that changes the structure.

Please guide.

I wish to get data from a selected row of the table grid.

Its not being accessed because the header lables are not there for the tablegrid.
I cannot hardcode it as the table structure is dynamic.

Is there is way to populate the header labels?

@yash1

If your columns are dynamic and your function returns different number of keys based on different data then there is currently no way to add in suggestion.

However, there is a workaround where you can modify your function to return all Number of Dynamic Keys and if it is a Custom function than add it inside MAPKEYS function as shown in below screenshot.

Now, you will be able to get Keyword of all your Columns in another control.

Hope this Helps!

Hey Fenil,

Thank you. I will toy around with this a little and see if works out.

Here you transpose function is returning a different dimention table, but the keys to which you have mapped the headers are static.

Will have to use two functions, 1 returning the transposed json and 2 returning the dynamic keys? with that work?

@yash1

Didn’t fully understand this but idea is whatever your final output is, you wrap that with MAPKEYS() function with all the keys expected. Here, point to note is order of keeps needs to be consistent in terms of order.