ajitg_4557
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2018
11:52 PM
How to create this structure using roArray and roAssociativeArray
Structure Like this:-
data = {
"device": "roku",
{
"movie_id": 12,
"watch_seconds": 3,
"collected_at": "06/19/2018"
},
{
"movie_id": 33,
"watch_seconds": 1,
"collected_at": "06/19/2018"
},
]
}
i am trying like this but it does not seem like as i want.
please look in it, and help.
thanks to all.
data = {
"device": "roku",
{
"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.
2 REPLIES 2

squirreltown
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2018
06:21 AM
Re: How to create this structure using roArray and roAssociativeArray
"movie_id": 33,
"watch_seconds": 1,
"collected_at": "06/19/2018"
}
Shouldn't be a coma after the last "}"
"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
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-04-2018
06:30 AM
Re: How to create this structure using roArray and roAssociativeArray
thanks for your reply squirreltown.