Use nested data problem
See original GitHub issueIs it possible to process my keys in moment? Need this for process nested data. I have template vars like this:
{user}
{user.name}
{user.age}
And data:
user: {
name: 'Alex',
age: 23,
country: 'Ukraine'
}
And want result:
Alex, 23, Ukraine
Alex
23
I see three interesting features to resolve issue: first: add .toString method to object (user), that call when use {user} key in template (if object has toString, than ObjectCommandResultError not appear) second: add functions aliases, that calls additionalJsContext functions. like if i put {{{user}}}, than i get result of additionalJsContext.getByKey(key) third: if typeof data === ‘function’, that function receive ‘key’ parameter, and than can process it async and return result
At this moment i use this construction, but its to scared :DD. Template:
{v(`user`)}
{v(`user.name`)}
{v(`user.age`)}
Code:
additionalJsContext: {
v: async key => {
let fieldValue = calculateFieldValue(key, documentData)
return fieldValue
},
},
And again as conclusion of 2 global problems:
- i cant use object string representation and object nested fields at one time.
- i must to know about all fields in template before render it. But i want to get needed data in moment, where i get key, and then put it into template
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Dealing with Complex and Nested Data
Nested data adds complexity to the data wrangling process of a dataset. The reason being, that it is not easy to consume in...
Read more >Powerful Statistical Inference for Nested Data Using Sufficient ...
To address this issue, we review several approaches to deal with nested data, with a focus on methods that are easy to implement....
Read more >Sampling and Nested Data in Practice- d h Based Research
Why are Nested Data a Problem? Research has shown that people within a particular Research has shown that people within a particular group...
Read more >Analyzing Nested (Clustered) Data | Center for Large ...
There are two basic approaches to working with nested data: Adjust standard errors of individual-level predictors to account for the potential bias introduced...
Read more >A Primer for Analyzing Nested Data: Multilevel Modeling in ...
This primer on conducting multilevel regression analy ses to address these issues using the Advanced Statistics module of SPSS IBM Statistics should be...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m also not shure what you want to do but with a Proxy you might be able to accive what you want - as you want to transform your data on the fly. But I would think transforming it before calling createReport is much simpler.
Hope this helped. If not, feel free to reopen.