json array

2 posts, 0 answers
  1. Marie
    Marie avatar
    1 posts
    Member since:
    Dec 2017

    Posted 10 Aug 2018 Link to this post

    I am currently evaluating your reporting tool.

    I am building a report that has a webservice as the data source. The response object is json. For some reason the report designer does not parse an array within json. The element recentScans is not parsing properly. Attached is an image showing the data explorer. 

     

    Here is data result for reference:

    {"productItem":{"productItemId":"e04f713f-ccb5-4b86-9df3-134018e4a8e0","gtin":"00333831111","gs1DataMatrix":"[01]00333831111[21]0[94]K+j3/SrR+17oIn74G9bWT4aBlU7x0K4I4M86bUEgXmBnvWRfr05zBTJ/L8zHEQX3xxUarCw8l0Rn82GaDkrDJJ5Mn5H4CwbnUmp1YlJmUiismoieHiFnKIbY6fLbFYrcXIIrOXe9aasNXlyaLmrRTkDLXz/ccOvIn34k9E+fmUC1n8lxrjRGlCGeKEEZAXwlNY5Ew43fmNYexV3aNOoqHGt6CqfteXpGqloUSS/d6zPoObK2Dq7KY1+MWSa1gQ0rQ8oAruvmLK2/1bN8iBaHHyd0pUx9/jyJok72K6UR/tpujICA1SpJuvSasA/Cj5gQ8WFZnsTRRgTK/L8ln3SSfQ==[95]e04f713f-ccb5-4b86-9df3-134018e4a8e0","serialNumber":"0","assetType":"Product","dbcEnc":"K+j3/SrR+17oIn74G9bWT4aBlU7x0K4I4M86bUEgXmBnvWRfr05zBTJ/L8zHEQX3xxUarCw8l0Rn82GaDkrDJJ5Mn5H4CwbnUmp1YlJmUiismoieHiFnKIbY6fLbFYrcXIIrOXe9aasNXlyaLmrRTkDLXz/ccOvIn34k9E+fmUC1n8lxrjRGlCGeKEEZAXwlNY5Ew43fmNYexV3aNOoqHGt6CqfteXpGqloUSS/d6zPoObK2Dq7KY1+MWSa1gQ0rQ8oAruvmLK2/1bN8iBaHHyd0pUx9/jyJok72K6UR/tpujICA1SpJuvSasA/Cj5gQ8WFZnsTRRgTK/L8ln3SSfQ==","gs1Map":{"gtin":"00333831111","serialNumber":"0","publicUuid":"e04f713f-ccb5-4b86-9df3-134018e4a8e0","digitalSignature":"K+j3/SrR+17oIn74G9bWT4aBlU7x0K4I4M86bUEgXmBnvWRfr05zBTJ/L8zHEQX3xxUarCw8l0Rn82GaDkrDJJ5Mn5H4CwbnUmp1YlJmUiismoieHiFnKIbY6fLbFYrcXIIrOXe9aasNXlyaLmrRTkDLXz/ccOvIn34k9E+fmUC1n8lxrjRGlCGeKEEZAXwlNY5Ew43fmNYexV3aNOoqHGt6CqfteXpGqloUSS/d6zPoObK2Dq7KY1+MWSa1gQ0rQ8oAruvmLK2/1bN8iBaHHyd0pUx9/jyJok72K6UR/tpujICA1SpJuvSasA/Cj5gQ8WFZnsTRRgTK/L8ln3SSfQ=="},"version":"1","batchRequestId":"3e60fe00-cecc-4c47-8268-282301883a24"},"product":{"productId":"e6e85dee-fcac-40e2-b767-8bb478a527d4","manufacturerId":"909a095e-8fd7-43ed-9bec-13648a8a66da","description":"Color-enhancing shampoo brightens & refreshes blonde, highlighted, and silver hair. ABC Manufacturer Lights Color-Enhancing Shampoo. A protein-enriched conditioning formula. Tones down brassiness on blonde/gray hair. Renews & refreshes faded highlights and ash-toned hair. Removes dull yellow in gray/white hair.","gtin":"00333831111","manufacturerName":"Generic","name":"Shampoo Extreme Color-enhancing","frontImageUrl":"https://connect.1statlas.com/shampoo_front.png","backImageUrl":"https://connect.1statlas.com/shampoo_back.png","properties":{"QRRewardImageUrl":"https://connect.1statlas.com/QR_code_coupon.png","instantRewardImageUrl":"https://connect.1statlas.com/beautysalons_coupon.png"}},"recentScans":[{"productItemLogId":"b5bf052d-7d39-4eb7-a34c-08aad7205319","productItemId":"e04f713f-ccb5-4b86-9df3-134018e4a8e0","timeOfLog":1533930678199,"action":"scan","latitude":30.266659,"longitude":-81.4395,"lat1000":30267,"lon1000":-81439,"city":"Jacksonville","state":"FL","zip":"32224","hourDistance":0.0,"dayDistance":0.0,"timeOfLogString":"2018-08-10 19:51","string":"Jacksonville, FL US"},{"productItemLogId":"f85ed19f-0015-4a3e-af27-541bbbf96369","productItemId":"e04f713f-ccb5-4b86-9df3-134018e4a8e0","timeOfLog":1533246137932,"action":"scan","latitude":44.438324,"longitude":-68.4032,"lat1000":44438,"lon1000":-68403,"city":"Ellsworth","state":"ME","zip":"04605","hourDistance":0.0,"dayDistance":0.0,"timeOfLogString":"2018-08-02 21:42","string":"Ellsworth, ME US"},{"productItemLogId":"5a2d2dbd-e0ff-44ac-b1ad-3172925d6763","productItemId":"e04f713f-ccb5-4b86-9df3-134018e4a8e0","timeOfLog":1533245974473,"action":"scan","latitude":44.438324,"longitude":-68.4032,"lat1000":44438,"lon1000":-68403,"city":"Ellsworth","state":"ME","zip":"04605","hourDistance":0.0,"dayDistance":0.0,"timeOfLogString":"2018-08-02 21:39","string":"Ellsworth, ME US"},{"productItemLogId":"0bf837dc-8a1f-4bca-96f5-32a0046c31e7","productItemId":"e04f713f-ccb5-4b86-9df3-134018e4a8e0","timeOfLog":1533245827826,"action":"scan","latitude":44.438324,"longitude":-68.4032,"lat1000":44438,"lon1000":-68403,"city":"Ellsworth","state":"ME","zip":"04605","hourDistance":0.0,"dayDistance":0.0,"timeOfLogString":"2018-08-02 21:37","string":"Ellsworth, ME US"},{"productItemLogId":"e54d7283-69bb-4407-a601-afffad4016da","productItemId":"e04f713f-ccb5-4b86-9df3-134018e4a8e0","timeOfLog":1533245819998,"action":"scan","latitude":44.438324,"longitude":-68.4032,"lat1000":44438,"lon1000":-68403,"city":"Ellsworth","state":"ME","zip":"04605","hourDistance":0.0,"dayDistance":0.0,"timeOfLogString":"2018-08-02 21:36","string":"Ellsworth, ME US"},{"productItemLogId":"2996e52e-245a-49e1-9828-c44b6799bdbe","productItemId":"e04f713f-ccb5-4b86-9df3-134018e4a8e0","timeOfLog":1533245805741,"action":"scan","latitude":44.438324,"longitude":-68.4032,"lat1000":44438,"lon1000":-68403,"city":"Ellsworth","state":"ME","zip":"04605","hourDistance":0.0,"dayDistance":0.0,"timeOfLogString":"2018-08-02 21:36","string":"Ellsworth, ME US"},{"productItemLogId":"3923d1fb-cd51-4e6a-b8ad-d05092a01b3a","productItemId":"e04f713f-ccb5-4b86-9df3-134018e4a8e0","timeOfLog":1533245167849,"action":"scan","latitude":44.438324,"longitude":-68.4032,"lat1000":44438,"lon1000":-68403,"city":"Ellsworth","state":"ME","zip":"04605","hourDistance":0.0,"dayDistance":0.0,"timeOfLogString":"2018-08-02 21:26","string":"Ellsworth, ME US"},{"productItemLogId":"5525f2bb-1595-4c49-9b2d-140460ac1341","productItemId":"e04f713f-ccb5-4b86-9df3-134018e4a8e0","timeOfLog":1533245162333,"action":"scan","latitude":44.438324,"longitude":-68.4032,"lat1000":44438,"lon1000":-68403,"city":"Ellsworth","state":"ME","zip":"04605","hourDistance":0.0,"dayDistance":0.0,"timeOfLogString":"2018-08-02 21:26","string":"Ellsworth, ME US"},{"productItemLogId":"892ad3a6-12e6-43b9-b701-57fe2481accd","productItemId":"e04f713f-ccb5-4b86-9df3-134018e4a8e0","timeOfLog":1533245086592,"action":"scan","latitude":44.438324,"longitude":-68.4032,"lat1000":44438,"lon1000":-68403,"city":"Ellsworth","state":"ME","zip":"04605","hourDistance":0.0,"dayDistance":0.0,"timeOfLogString":"2018-08-02 21:24","string":"Ellsworth, ME US"},{"productItemLogId":"1c564a93-8df1-46c8-8622-3a6745eed1c3","productItemId":"e04f713f-ccb5-4b86-9df3-134018e4a8e0","timeOfLog":1533244894243,"action":"scan","latitude":44.437504,"longitude":-68.4032,"lat1000":44438,"lon1000":-68403,"city":"Ellsworth","state":"ME","zip":"04605","hourDistance":0.0,"dayDistance":0.0,"timeOfLogString":"2018-08-02 21:21","string":"Ellsworth, ME US"},{"productItemLogId":"6a6a4cf8-bc56-44a4-8b48-859983b3f1fe","productItemId":"e04f713f-ccb5-4b86-9df3-134018e4a8e0","timeOfLog":1533244821262,"action":"scan","latitude":44.438324,"longitude":-68.4032,"lat1000":44438,"lon1000":-68403,"city":"Ellsworth","state":"ME","zip":"04605","hourDistance":0.0,"dayDistance":0.0,"timeOfLogString":"2018-08-02 21:20","string":"Ellsworth, ME US"},{"productItemLogId":"45a14e8c-79bf-4ad7-92de-b7eb9fb80635","productItemId":"e04f713f-ccb5-4b86-9df3-134018e4a8e0","timeOfLog":1533244443870,"action":"scan","latitude":44.437504,"longitude":-68.4032,"lat1000":44438,"lon1000":-68403,"city":"Ellsworth","state":"ME","zip":"04605","hourDistance":0.0,"dayDistance":0.0,"timeOfLogString":"2018-08-02 21:14","string":"Ellsworth, ME US"},{"productItemLogId":"34a7e628-7249-473c-abed-bca0d3fc51b3","productItemId":"e04f713f-ccb5-4b86-9df3-134018e4a8e0","timeOfLog":1533244223276,"action":"scan","latitude":44.437504,"longitude":-68.4032,"lat1000":44438,"lon1000":-68403,"city":"Ellsworth","state":"ME","zip":"04605","hourDistance":0.0,"dayDistance":0.0,"timeOfLogString":"2018-08-02 21:10","string":"Ellsworth, ME US"},{"productItemLogId":"687e90db-90f2-4c2b-9a5b-6999e33c497d","productItemId":"e04f713f-ccb5-4b86-9df3-134018e4a8e0","timeOfLog":1533244155810,"action":"scan","latitude":44.437504,"longitude":-68.4032,"lat1000":44438,"lon1000":-68403,"city":"Ellsworth","state":"ME","zip":"04605","hourDistance":0.0,"dayDistance":0.0,"timeOfLogString":"2018-08-02 21:09","string":"Ellsworth, ME US"},{"productItemLogId":"b133e620-4f6d-42c0-8e6c-3219d78e9082","productItemId":"e04f713f-ccb5-4b86-9df3-134018e4a8e0","timeOfLog":1533243934151,"action":"scan","latitude":44.437504,"longitude":-68.4032,"lat1000":44438,"lon1000":-68403,"city":"Ellsworth","state":"ME","zip":"04605","hourDistance":0.0,"dayDistance":0.0,"timeOfLogString":"2018-08-02 21:05","string":"Ellsworth, ME US"},{"productItemLogId":"2b83c288-6c32-4dff-910b-1a0e574e0b44","productItemId":"e04f713f-ccb5-4b86-9df3-134018e4a8e0","timeOfLog":1533138505588,"action":"scan","latitude":30.267235,"longitude":-81.43838,"lat1000":30267,"lon1000":-81438,"city":"Jacksonville","state":"FL","zip":"32224","hourDistance":0.0,"dayDistance":0.22,"timeOfLogString":"2018-08-01 15:48","string":"Jacksonville, FL US"},{"productItemLogId":"e6e8f13b-66dd-4ecc-b684-378632f6cdf1","productItemId":"e04f713f-ccb5-4b86-9df3-134018e4a8e0","timeOfLog":1533132242447,"action":"scan","latitude":30.266901,"longitude":-81.43961,"lat1000":30267,"lon1000":-81440,"city":"Jacksonville","state":"FL","zip":"32224","hourDistance":0.0,"dayDistance":0.0,"timeOfLogString":"2018-08-01 14:04","string":"Jacksonville, FL US"},{"productItemLogId":"af2c2d66-c772-4545-accb-490133cb50b8","productItemId":"e04f713f-ccb5-4b86-9df3-134018e4a8e0","timeOfLog":1533132224903,"action":"scan","latitude":30.266901,"longitude":-81.43961,"lat1000":30267,"lon1000":-81440,"city":"Jacksonville","state":"FL","zip":"32224","hourDistance":0.0,"dayDistance":0.0,"timeOfLogString":"2018-08-01 14:03","string":"Jacksonville, FL US"},{"productItemLogId":"0544a50c-dd7c-4990-baf0-9cdf753941bf","productItemId":"e04f713f-ccb5-4b86-9df3-134018e4a8e0","timeOfLog":1533131832783,"action":"scan","latitude":30.2669,"longitude":-81.43962,"lat1000":30267,"lon1000":-81440,"city":"Jacksonville","state":"FL","zip":"32224","hourDistance":0.0,"dayDistance":0.0,"timeOfLogString":"2018-08-01 13:57","string":"Jacksonville, FL US"}],"success":true,"recentScanCount":19}

  2. Nasko
    Admin
    Nasko avatar
    1049 posts

    Posted 15 Aug 2018 Link to this post

    Hello Marie,

    When the data field is an array or a collection of objects the nested objects' properties will not be visible or directly accessible. To access these properties you need to bind the recentScans data field to another Data Item.
    This exact scenario is described step by step in How to: Connect to Google Books APIs (step 9).


    If you need to use only the inner array/collection data in the report without any parent data fields, then querying the JSON is also an option - How to: Use JSONPath to filter JSON data. (This functionality is available in the latest internal build of Telerik Reporting.)

    Regards,
    Nasko
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top