TableGrid control not displaying Result of JSON when modified

Hello,

I am trying to transpose Coloum data into rows.

  1. I have stored the data in a JSONStore.
    JSONStore: Colour Size Matrix
    {
    “MasterPo”: “1”,
    “Color”: “red”,
    “Size”: “M”,
    “Quantity”: “1”
    },
    {
    “MasterPo”: “1”,
    “Color”: “red”,
    “Size”: “S”,
    “Quantity”: “2”
    }
    ]
    image

  2. We have a custom function “transpose” to transpose the data.
    So the function is working.
    [
    {
    “MasterPo”: “1”,
    “Color”: “red”,
    “M”: “1”,
    “S”: “2”
    }
    ]
    image

  1. Here the json key value pair is hardcoded, in “Tablegrid2.”
    so the tablegrid displays the result within the formula.

There are 2 Problems I am facing.
A) When I try and run the application, the table grid does not display anything.

Here Tablegrid2 is empty. but table grid3, which references tablegrid2 displays the desired result. Ideally Tablegrid2 should display the result.
image

B) When I pass jsonstore as the argument to transpose(), the tablegrid control doesnot display the result. Neither tablegrid2 or tablegrid3.
image

Kindly help me display the modified JSONStore in Tablegrid.

I would like to highlight, the Header Lables, get predefined when jsonstore is an argument.
The transpose function returns a json store with modified Header Lables, as size rows become coloumns.

Is that what is causing the problem?
image

Regards

@yash1

For Issue A - You can try Empty cache and Hard Reload OR open it in incognito and Save and Validate and Run. This should be working fine now.

For Issue B - Not sure of the Data of JSON Store but if the data is same as above case, it should also be working fine.

Here, Transpose function is a custom function - If you can share the raw output of the function and not the table output will help in case this issue is still persisting.

Hope this Helps!

Hello,

The data in Issue A and B are exactly same. A was hardcoded to make the illustration easier to understand.

Usecase is to generate a LOOKUP() from a file. Store it in a JSONStore/DataStore and display it on table grid after transposing.

transpose() Function is working as is illustrated by the formula section upon save and validate.

Not sure what you mean by refering to RAW data. I am attaching two snapshots.

  1. Console
  2. transpose() applied to Lookup under formula section and save and validated.

raw

I have tried the actions that you have mentioned. The matter is still unresolved.

regads

@yash1

We noticed one thing in the above screenshot, the transpose function is returning different number of keys in 2 json objects. For tablegrid to populate correctly, it should have same number of Keys in all the objects. Can you have a look into the Transpose function to handle this behaviour?

LOOKUP will return same number of keys in all the objects.

Hope this Helps!

Thank you Fenil, for looking at the code and suggesting the return argument was not correct. Upon the changes, I was able to get the desired result.

Regards