How to acces value of field from another data source (JSON)?


I'm creating a report using two datasources (the format is JSON).

The structure of JSON is like:

            "parameter1" : 123,
            "key" : 1,        
            "key" : 2,        

So I have two datasources. One for the first object (firstSource) and another (secondSource) for second object (array of objects).

The array (second) is printed in the table component. I'd like to access a field from first object (first.parameter1) and print it in the table header.

The table is using this dataset:

<datasetRun uuid="4ee63b06-f4ee-45b4-9da8-3dabc3e7a09d">

Then I'm printing its fields using $F{key}.

Do you know how can I access the parameter1 of the first object from table? Maybe using some sort of $V{} variable or merging both datasources?

I tried to use subDataSource and subDataSet approach without any luck.

Here's something I'd like to achieve in the result table:


gagarin's picture
Joined: Aug 8 2018 - 5:31am
Last seen: 5 years 1 month ago

Why not have the whole JSON data populating the main data source?

narcism - 5 years 1 month ago

0 Answers:

No answers yet