Merge Multiple JSON key value into single array
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2021 10:31 AM
Hi Team,
How to merge the multiple JSON key-value pair in the client-side script?
Current Format:
{"name1":"test1","name2":"test2"},{"name3":"test3","name4":"test4"}
Expected Format:
[{"name1":"test1","name2":"test2"},{"name3":"test3","name4":"test4"}]
Labels:
- Labels:
-
Incident Management
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2021 10:57 AM
Hello,
You can just push the value to the array like:
var data = {"name1":"test1","name2":"test2"},{"name3":"test3","name4":"test4"};
var dataArray = [];
dataArray.push(data);
Geoff