You can translate the question and the replies:

JSON Data Source: Tuple root value to "/JSONFile/jsonarray" not giving results

Hello, I am trying to create a new JSON Data Source of the following URL: https://data.cdc.gov/resource/52kb-ccu2.json I am using Admit Tool of 8.0 20210209 and VDP Server of 8.0 20210715 If you put that URL in the browser, you will see something like this: [{"testtype":"Antigen","season":"1011","repweekcode":"1027","repweekdate":"10JUL2010","hhs_region":"1","rsvpos":"0","rsvtest":"105","outlier":"0"} ,{"testtype":"Antigen","season":"1011","repweekcode":"1028","repweekdate":"17JUL2010","hhs_region":"1","rsvpos":"0","rsvtest":"116","outlier":"0"}] I create a new JSON Datasource with HTTP method of GET, URL just like above and a name of dv_cdc. When I Test Connection, it is successful. I click on "Create base view" button. A modal dialog shows up that says "Configure JSON Wrapper". I left the "JSON root" checked and a tuple root value of /JSONFile. I click on OK which brings me to the base view configuration dialog. It shows 1 field name of "jsonarray" which can be expanded to show the additional fields such as testtype, etc. i rename the base view to bv_cdc and then save the base view. If I now execute: SELECT * FROM bv_cdc the results show a single field called "jsonarray" which can be expanded. I decide to create another base view off of ds_cdc but I want this base view to show the jsonarray as the table directly. I click on "Create base view" button of the data source again. A modal dialog shows up that says "Configure JSON Wrapper". This time, I uncheck "JSON root" and change the Tuple root value to "/JSONFile/jsonarray" and then hit ok. The base view configuration dialog no longer shows a Field Name of "jsonarray" but instead shows 8 fields. I name the base view bv_cdc_flat and hit Save. If I now execute: SELECT * FROM bv_cdc_flat no results are shown. Any thoughts? What am I doing wrong? Thanks, Dan
user
13-02-2023 14:26:59 -0500
code

1 Answer

Hi, I was able to get results by creating a Flatten View after following your steps to the point where you saved the bv_cdc view and queried it. You need to make a Flatten View. In Server Explorer, right-click the bv_cdc and select New > Flatten. In the Model tab, select the box next to jsonarray and verify the fields in the Flatten Preview. Modify the Flatten view using the other tabs, then save the view. You should refer to the [Creating Flatten Views](https://community.denodo.com/docs/html/browse/8.0/en/vdp/administration/creating_derived_views/creating_flatten_views/creating_flatten_views) section of the Virtual DataPort Administration Guide for additional information. Hope this helps!
Denodo Team
13-02-2023 16:54:21 -0500
code
You must sign in to add an answer. If you do not have an account, you can register here