I have two strings separated by commas that I want to transform into an array of objects.
{
"id": "1,2,3",
"name": "test 1, test 2, test 3"
}
Is there a way to convert this into the desired object format?
{
"selectedDataConcepts": {
"dataConcepts": [{
"id": "1",
"name": "test 1"
},
{
"id": "2",
"name": "test 2"
},
{
"id": "3",
"name": "test 3"
}
]
}
}
I've tried multiple approaches without success. Any help with finding a solution would be greatly appreciated.