Botpree and make.com
# 🤝help
c
Good day guys I'm trying to integrate botpress with make.com because I can't afford zapier. I've not been able to get it to fill the google sheet using webhooks I need help getting right please 🙏
t
I'm trying to create a scenario with Make to. But I can't find the base URL to fill HTTP module...
c
The url is on the web hook node
This should be it

https://cdn.discordapp.com/attachments/1132719482373165056/1132736186075586781/rn_image_picker_lib_temp_15f3a0de-ec49-448f-a2ac-d312484b653a.jpg

a
i have had success with Active Pieces writing to google sheets as i didnt want to pay for Zapier. code i used for execute code is below. I was just sending a a few variables to google sheets workflow.zapierSuccess = false; const leadData = { Store: workflow.WHAT_STORE, "hours changes": workflow.new_opening_hours }; try { const response = await axios.post('PASTE WEBHOOK FROM ACTIVEPEICES HERE', leadData); console.log(response.data); workflow.zapierSuccess = true; } catch (error) { // Handle the error here if needed }
l
is this code working for anyone? I tried multiple codes but I cant webhook the right data from botpress to google sheets. its supposed to say Name, Email, Number in my case but its giving me a whole bunch of other information that I dont want
a
it works for me returning variables. change WHAT_STORE to your variable name and try again. Im also sending variable new_opening_hours in above code
t
I want to use HTTP module, not a webhooks. So I need base URL to call API
h
Why do you want to use HTTP Module? With HTTP module the automation can make requests. With a Webhook the automation receives requests. Be sure to send 1 request to the webhook to get the datastructure and be able to access the data inside.
c
Extract data from Botpress context const leadData = { name: event.state.workflow.name, email: event.state.workflow.email, phone: event.state.workflow.phoneno, }; // Define the webhook URL const webhookUrl = 'https://; // Send data to the webhook try { const response = await axios.post(webhookUrl, leadData); event.state.workflow.makeSuccess = true; // Indicate success in Botpress context } catch (error) { event.state.workflow.makeSuccess = false; // Indicate failure in Botpress context console.error(error) Can anyone help me confirm this code would enable me send data to the webhook I've tried and it's not working I probably made a mistake somewhere help please
h
Try this
Copy code
js
const leadData = {
  name: workflow.name,
  email: workflow.email,
  phone: workflow.phoneno
};

// Define the webhook URL
const webhookUrl = 'https://;

// Send data to the webhook
try {
  await axios.post(webhookUrl, leadData);
  event.state.workflow.makeSuccess = true;  // Indicate success in Botpress context
} catch (error) {
  event.state.workflow.makeSuccess = false;  // Indicate failure in Botpress context
  console.error(error)
}
Variables are stored in the workflow object not in the event.state.workflow
Make sure you have the webhook URL set
I am not sure what
event.state.workflow.makeSuccess
this is but if its a variable called makeSuccess you want to remove the event.state
c
thanks this was really helpful