I am querying the following data:
[{
"id": "post_83eb1f2e-6ac4-4ac0-9058-bf1a708743de",
"title": "Post Title 1",
"stats": {
"email": {
"recipients": 0
},
"web": {
"views": 0,
"clicks": 0
},
"clicks": []
}
}, {
"id": "post_08550733-28c5-4ceb-a13e-6b5bc960708f",
"title": "Post Title 2",
"stats": {
"email": {
"recipients": 100
},
"web": {
"views": 0,
"clicks": 0
},
"clicks": [{
"url": "https://www.instagram.com/somethingorother/?utm_campaign=generic-auto-campaign-value",
"total_clicks": 39
}, {
"url": "https://go.testdomain.com/test?utm_source=em-en&utm_medium=e&utm_campaign=thecampaign&utm_id=896",
"total_clicks": 54
},
]
}
}
]
and attempting to get out
id, title, campaign
post_83eb1f2e-6ac4-4ac0-9058-bf1a708743de,Post Title 1,NULL
post_08550733-28c5-4ceb-a13e-6b5bc960708f,Post Title 2,thecampaign
for URL I am looking to parse out the utm_campaign of the first go.testdomain.com url in the clicks array.. if present but can't get to even getting the full URL.
I've tried understanding and using the AlaSQL SEARCH syntax but so far no luck. Any ideas would be much appreciated!