1. David Hepburn
  2. PowerBuilder
  3. Tuesday, 17 November 2020 21:23 PM UTC

I need to use RESTclient to retrieve the JSON results into my datawindow. Only problem is the results are multiple level so I don't know what columns I need. Can someone help me with the dw columns I would need for these JSON results:

{"asset":[{"asset_id":"5476767812405d056d7056297a7f0d015d2159406e52","creative_id":"737d4b5b2e5b6f4b6e3b74291c5a35076f69515f2164","campaign_id":3516841684,"asset_url":"https://transcodes-cdn.vistarmedia.com/DyGIJQByR9CU4zq_j9GwxA/DyGIJQByR9CU4zq_j9GwxA.mp4","width":1080,"height":1920,"mime_type":"video/mp4","length_in_seconds":15,"length_in_milliseconds":15000,"creative_category":"10017","advertiser":"test","creative_name":"005183_The_Wilderness_Society_Political (1).mp4"},{"asset_id":"004874243b5562426d7270195b51301a5f1e426d0f64","creative_id":"786842212546794268544e3a6d59050d4468211e1a42","campaign_id":1188440451,"asset_url":"https://transcodes-cdn.vistarmedia.com/OlN3ALTpTVyFEyAUA876Cg/OlN3ALTpTVyFEyAUA876Cg.mp4","width":1080,"height":1920,"mime_type":"video/mp4","length_in_seconds":15,"length_in_milliseconds":15000,"creative_category":"10105","advertiser":"test","creative_name":"005239 Spicers Retreats - Where it All Began.mp4"}]}

 

Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Tuesday, 17 November 2020 21:28 PM UTC
  2. PowerBuilder
  3. # 1

Hi David;

   You have to remember that the DWO is only two dimensional (rows & columns). Thus, multi-dimensional result sets are not a candidate to the DWO JSON import.

   Instead, you will need to use the JSONParser object class and its GetItemXxxx() commands to read and decipher the datum. Then you would use the DC/DS SetItem() command to load the DWO(s) primary buffer from the JSON parse.

Regards ... Chris

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.