Your Digital Media Has Never Looked So Good

 
ajitg_4557
Topic Author
Posts: 26
Joined: Thu Feb 16, 2017 5:53 am
Location: Noida,Uttar pradesh,India
Contact:

How to create this structure using roArray and roAssociativeArray

Mon Jul 02, 2018 11:52 pm

Structure Like this:-

data = {
"device": "roku",
"metrics": [
   {
     "movie_id": 12,
     "watch_seconds": 3,
     "collected_at": "06/19/2018"
   },
   {
     "movie_id": 33,
     "watch_seconds": 1,
     "collected_at": "06/19/2018"
   },
]
}


parent_AA=CreateObject("roAssociativeArray")
Child_Arr=CreateObject("roArray", 10, true)
Child_AA=CreateObject("roAssociativeArray")
for i=0 to 10
 Child_AA.AddReplace("one"+i,"i")
 Child_Arr.push(Child_AA)
end for
parent_AA.devices = "Roku"
parent_AA.Append(Child_Arr)
print"parent_AA=======>>>>>"parent_AA


i am trying like this but it does not seem like as i want.
please look in it, and help.
thanks to all.
 
User avatar
squirreltown
Posts: 870
Joined: Sun Apr 21, 2013 2:20 pm

Re: How to create this structure using roArray and roAssociativeArray

Tue Jul 03, 2018 6:21 am

     "movie_id": 33,
     "watch_seconds": 1,
     "collected_at": "06/19/2018"
   }

Shouldn't be a coma after the last "}"


data = {
  "device": "roku",
  "metrics": []
}

data.metrics.push(  {

     "movie_id": 12,
     "watch_seconds": 3,
     "collected_at": "06/19/2018"

   } )

data.metrics.push(  {  
     "movie_id": 33,
     "watch_seconds": 1,
     "collected_at": "06/19/2018"
   } )
Kinetics Screensavers
 
ajitg_4557
Topic Author
Posts: 26
Joined: Thu Feb 16, 2017 5:53 am
Location: Noida,Uttar pradesh,India
Contact:

Re: How to create this structure using roArray and roAssociativeArray

Wed Jul 04, 2018 6:30 am

thanks for your reply squirreltown.

Who is online

Users browsing this forum: No registered users and 2 guests