https://discord.gg/botpress logo
#🤝help
Botpree and make.com
# 🤝help
c

calm-memory-95532

07/23/2023, 5:02 PM
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

thankful-pharmacist-651

07/23/2023, 5:20 PM
I'm trying to create a scenario with Make to. But I can't find the base URL to fill HTTP module...
c

calm-memory-95532

07/23/2023, 6:06 PM
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

alert-apartment-89957

07/23/2023, 9:55 PM
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

loud-table-58834

07/24/2023, 1:23 AM
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

alert-apartment-89957

07/24/2023, 1:30 AM
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

thankful-pharmacist-651

07/24/2023, 5:15 AM
I want to use HTTP module, not a webhooks. So I need base URL to call API
h

helpful-vr-6699

07/24/2023, 9:05 AM
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

calm-memory-95532

07/26/2023, 7:44 AM
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

helpful-vr-6699

07/28/2023, 6:51 AM
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

calm-memory-95532

08/03/2023, 12:15 PM
thanks this was really helpful