cancel
Showing results for 
Search instead for 
Did you mean: 

Json object

esmail
New Contributor

I need help to get below output.

"order":{
"0d8351c5-22dd-4e15-95b4-d2808cce70df":"11111111-1111-1111-1111-000000000000",
"ba653ecd-0b8d-4af4-97d0-5d758a37512d":"11111111-1111-1111-1111-000000000001"
}

expected result

"order":{
  {
    "class_id":"0d8351c5-22dd-4e15-95b4-d2808cce70df",
    "order" :"11111111-1111-1111-1111-000000000000"
  },
  {
    "class_id":"ba653ecd-0b8d-4af4-97d0-5d758a37512d",
    "order" :"11111111-1111-1111-1111-000000000001"
  }
}

Thanks for your help.

1 ACCEPTED SOLUTION

ptaylor
Employee
Employee

Use this expression:

$order.entries().map(e => {"class_id": e[0], "order": e[1]})

View solution in original post

2 REPLIES 2

ptaylor
Employee
Employee

Use this expression:

$order.entries().map(e => {"class_id": e[0], "order": e[1]})

esmail
New Contributor

Thank You 💪