Question

Parse Raw Body recieved from Catch Raw Hook

  • 24 April 2023
  • 2 replies
  • 398 views

I have created the JS that is capturing some data and I am passing it to Zapier via a Post with Ajax. Here is the example code that I am using and shows how the data is getting passed.

 

 $.ajax({
  type: "POST",
  url: "https://hooks.zapier.com/hooks/catch/***",
  data: "{'Id': 1111,'email': 'test@test.com'}",
  success: function (result) {
     console.log(result);
  },
  dataType: "json"
});
</script>

 

This script works and the data I need passed is working great. The data as it come in is getting passed into the Raw Body field. I am needing to get the email from this data so that I can then use it to send an email thru Zapier.

 

All the parse code that I have tried is not working and I keep getting a JSON error. Once i have it parsed - I realized I don’t have a data field to use to add to the email Zapier option.

Is there any examples of how to parse this data and save it to a zapier data field so I can use it in an email?


This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

2 replies

I have this simple code to run

var content = inputData.body;

var email = content['email'];

output = {'customer' : content['email']};

 

This was after I was getting an error that basically said that this data has already been parsed.

I am still not getting an output that I can use in the Email Zapier module.

 

Userlevel 7
Badge +14

Hi @StarSeed23 

Good question.

Perhaps try using Catch Hook instead of Catch Raw Hook.

Can you post detailed screenshots with how your Zap steps are configured along with example data that you are trying to use to give use enough context?