Looking for a bit of assistance here. I can't seem to get this working.
My use-case is click data from marketing emails. I'm trying to update a field with the # of unique (distinct) link clicks of a particular link.
I'm using an API call to return all click data in a {{webResponse}} object.
The response data looks something like this:
"ClickData": [ { "UserEmail": "test1@gmail.com", "LinkUrl": "https://www.google.com/", "Click Date": "2024-01-01" }, { "UserEmail": "test1@gmail.com", "LinkUrl": "https://www.google.com/", "Click Date": "2024-01-01" }, { "UserEmail": "test2@gmail.com", "LinkUrl": "https://www.google.com/", "Click Date": "2024-01-01" }, { "UserEmail": "test2@gmail.com", "LinkUrl": "https://www.adobe.com/", "Click Date": "2024-01-01" }, { "UserEmail": "test3@gmail.com", "LinkUrl": "https://www.apple.com/", "Click Date": "2024-01-01" }]
Hi @Matthew Challenger For getting the count of an email address from a JSON response, you can use this smartvalue :
{{webhookData.ClickData.UserEmail.match(".*(test1@gmail.com).*").size}}
It gives count result : 2. Count number of times test1@gmail.com comes in a JSON body.
Sorry, maybe I wasn't clear.
I would like to know how many (distinct) users clicked on "https://www.google.com".
If "test1@gmail.com" had 10 records of click data, I would still only want to count them once.
Also hoping for some advice from @Bill Sheboy, as a lot of the approaches I've tried so far are based on community questions where you shared valuable insights in helping others with somewhat similar challenges.
Hi @Matthew Challenger
This is possible, and...
It would likely take me as longer to implement and fully test this than for you to do so...primarily because you have access to the source sending the message, and so can foresee any challenges and edge cases.
Some recommendations to get this started:
If you get stuck, please post your rule details so the community can help.
Kind regards,Bill
Hi @Bill Sheboy I've tried some RegEx matching and Splitting already, but not with that pattern or in that way. I'll give it a shot in the coming days and let you know. I'm hoping this points me in the right direction of a solution. Thank you!
okay @Matthew Challenger I understand now,
Try this smartvalue : {{webhookData.ClickData.UserEmail.distinct.size}}
It gives you the count of distinct email address.
Above date it gives : 3
Yes, I would only want 2, because test3@gmail.com never clicked on the specific link I'm looking for.
It looks like you're new here. Sign in or register to get started.