Avatar of Coast Line
Coast Line
Flag for Canada asked on

looping over JSON Object and insert into query

Hi, I have the following JSON Object and i am trying to insert into the database:

try to find a simple way so loop over and it keeps on inserting and append the messages in the variable:

more important are the values which are inside the data say :
0
1
2
3
4
5
6
7
8 and its nested values

here is the attached JSON

{
   "status":"OK",
   "data":{
      "group_id":1522413460,
      "0":{
         "id":"1522413460-1",
         "customid":"",
         "customid1":"",
         "customid2":"",
         "mobile":"000000000",
         "status":"AWAITED-DLR"
      },
      "1":{
         "id":"1522413460-2",
         "customid":null,
         "customid1":null,
         "customid2":null,
         "mobile":"000000000",
         "status":"AWAITED-DLR"
      },
      "2":{
         "id":"1522413460-3",
         "customid":null,
         "customid1":null,
         "customid2":null,
         "mobile":"000000000",
         "status":"AWAITED-DLR"
      },
      "3":{
         "id":"1522413460-4",
         "customid":null,
         "customid1":null,
         "customid2":null,
         "mobile":"",
         "status":"INV-NUMBER"
      }
   },
   "message":"Campaign of 4 numbers Submitted successfully."
}

Open in new window

ColdFusion Language

Avatar of undefined
Last Comment
Coast Line

8/22/2022 - Mon
Mr_Nil

Have you tried using the deserializeJSON function?
ASKER CERTIFIED SOLUTION
Mr_Nil

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Coast Line

ASKER
i will check today
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck