How to get values using json in vba excel

manurockz007

New Member
Joined
Dec 12, 2016
Messages
30

How do i separate all the values from the following

{
"anonymousId": "12dhdhdhfds548521555",

"event": "sample",
"integrations": {},
"messageId": "1455gdhggdddddggg154",
"properties": {
"test_play_percentage": "0.926",
"test_video_duration": 148.95600907029478,
"test_video_position": 138,
"test_video_url": "https://www.youtube.com/watch?v=dghssdghfddgs",
"site_type_id": 10
},

To get an output where all the values should be separate.

<tbody>
</tbody>
I need to get values anonymousId, event, and other values in a separate cell in excel and also loop it so that i can get number of data done in one time.
Once we place data in a cell it should automatically separate the values not need of button to perform the action.
Advance thanks.

 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Hi,

In VBA you should first remove "{" and "}," from the string using the replace function.
When done, you can split the string into an array of tag/value pairs using the split function on the "," Pairs = Split(String, ",").
Each pair can be split on the the colon (":") into tag and value.

Hope this helps
 
Upvote 0

Forum statistics

Threads
1,214,652
Messages
6,120,746
Members
448,989
Latest member
mariah3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top