I have the option to pull a raw webhook from my affiliates list. It comes in as one string and I want to extract the First Name and Email.
Yes, raw webhook is the only option I have right now. I know there’s an extract email feature in Zapier but I really need the name too and can’t figure out how to get that.
This post has been edited by a moderator to remove sensitive information. Please remember to remove any personally identifiable information prior to posting as this is a public forum.
@Troy Tessalone Thanks! I tried the Split but couldn’t figure it out. The other two options are over my head What would be the best option to use?
@bigcatcreative
If you want to use 1 Code step…
Map the webhook data from the trigger step to the RAW input right side
(replace the static data shown in the screenshot)
let RAW = inputData.RAW.replace(/"/g,'');
let NameFirst = RAW.split("s:5:"):1].split(";");0].trim(); let NameLast = RAW.split("s:8:"):1].split(";");0].trim(); let Email = RAW.split("s:20:"):1].split(";");0].trim();
output = {NameFirst, NameLast, Email, RAW}];
Output
This post has been edited by a moderator to remove sensitive information. Please remember to obfuscate any personally identifiable information prior to posting as this is a public forum.
Thanks so much @Troy Tessalone - it seems to be working. You’re a life saver!
@Troy Tessalone Never mind, that only seemed to work for that specific case. When I pull in different data, the code fails. When I pull in different data the numbers change, here’s some examples:
let NameFirst = RAW.split("f_name;"))1].split(':'))2].split(";"))0].trim(); let NameLast = RAW.split("l_name;"))1].split(':'))2].split(";"))0].trim(); let Email = RAW.split("email;"))1].split(':'))2].split(";"))0].trim();
output = {NameFirst, NameLast, Email, RAW}];
@Troy Tessalone So far so good, thank you thank you!!!