question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

support nested JSON?

See original GitHub issue

I have a nested JSON object like:

[
    {
        user : {
            "fname" : "Joe",
            "lname" : "Smith"
        },
        execution : {
            ...
        }
    }
...
]

I tried methods mentioned in #98 such as:

settings:{
        columns:{
              user:{
                     title:"First Name",
                     valuePrepareFunction: (user) => {
                         return user.fname;
                     }
              },
              user:{
                     title:"Last Name",
                     valuePrepareFunction: (user) => {
                         return user.lname;
                     }
              }
        }
}

Although this doesn’t work and only displays the last one. image

Is there any way to have this functionality? Or do I need to reformat my JSON?

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:3
  • Comments:8

github_iconTop GitHub Comments

4reactions
raycolacommented, Mar 12, 2018

I resolved like this…

`

// my model export class Profile { id: number; desc: string; }

// my list of values. you can load from services… 😃 and map to {value, title} structure profileFilterList = [ { value: 1, title: ‘A’ }, { value: 2, title: ‘B’ }, { value: 3, title: ‘C’ } ]; … other columns … “profile”: { “title”: “Profile”, valuePrepareFunction: (cell: any, row: any) => { return row.profile.desc }, filter: { type: ‘list’, config: { selectText: ‘All’, list: this.profileFilterList } }, filterFunction(profile?: any, search?: string | number): boolean {

        let match = profile.id == search;
        if (match || search === '') {
          return true;
        } else {
          return false;
        }
      }
     
    },`

Hope it works!

1reaction
mathuranubhavcommented, Nov 14, 2017

The same problem occours when trying to use the Sorting/Filtering on the columns.

Read more comments on GitHub >

github_iconTop Results From Across the Web

JSON nested objects
JSON nested objects ... Objects can be nested inside other objects. Each nested object must have a unique access path. The same field...
Read more >
Format Nested JSON Output with PATH Mode - SQL Server
PATH mode lets you create wrapper objects and nest complex properties. The results are formatted as an array of JSON objects.
Read more >
Nested JSON (.json) - Phrase - Memsource
No information is available for this page.
Read more >
Simplify Querying Nested JSON with the AWS Glue ...
Relationalize transforms the nested JSON into key-value pairs at ... Let's look at how Relationalize can help you with a sample use case....
Read more >
Nested JSON objects - do I have to use arrays for everything?
You don't need to use arrays. JSON values can be arrays, objects, or primitives (numbers or strings). You can write JSON like this:...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found