how can i check for duplicate entries in my JSON

Chris375
Kilo Contributor

Hi i want to find duplicate entries in my JSON for example:

[
   {
      "IO:a02a76a7b7989150c788f78a0e8c024e":"false",
      "open_to":"",
      "open_day":"dd4e39c3b7e3c5100071f78a0e8c0208",
      "closed":"true",
      "open_from":"",
      "open_item_type":""
   },
   {
      "open_to":"",
      "open_day":"743e7d83b7e3c5100071f78a0e8c02a9",
      "closed":"true",
      "open_from":"",
      "open_item_type":"",
      "IO:932af6a7b7989150c788f78a0e8c02a9":"false"
   },
   {
      "open_to":"",
      "open_day":"f9ae7dc3b7e3c5100071f78a0e8c02f3,8c9eb9c3b7e3c5100071f78a0e8c02da",
      "closed":"true",
      "open_from":"",
      "open_item_type":"",
      "IO:9bebf2e7b7989150c788f78a0e8c0230":"false"
   },
   {
      "open_to":"13:15",
      "open_day":"743e7d83b7e3c5100071f78a0e8c02a9,625e39c3b7e3c5100071f78a0e8c0279,548ef5c3b7e3c5100071f78a0e8c0236",
      "closed":"false",
      "open_from":"12:15",
      "open_item_type":"OTC",
      "IO:e5cbf6e7b7989150c788f78a0e8c0207":"false"
   }
]

and now i want to check if a sys_id in open_day is double in my json like here 743e7d83b7e3c5100071f78a0e8c02a9

can someone help me please?

1 ACCEPTED SOLUTION

Sagar Pagar
Tera Patron

Hi,

Take a look at old thread -  Removal of duplicate objects from JSON array

 

Thanks,

Sagar Pagar

The world works with ServiceNow

View solution in original post

2 REPLIES 2

Sagar Pagar
Tera Patron

Hi,

Take a look at old thread -  Removal of duplicate objects from JSON array

 

Thanks,

Sagar Pagar

The world works with ServiceNow

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

this link has solution

Removing duplicate objects from a JSON aray

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader