https://discord.gg/botpress logo
HELP. Per master Shifu, I am a Lvl zero.
# 🤝help
q
I am attempting to build 1 bot for a Medicare website, for myself. I have been watching Botpress videos for a few weeks, Lied to myself and said " You can do this :)" I have 1 Autonomous node (works great by itself) I transitioned to a standard node to capture user data such as: 1. Name 2. Email 3. Zip code 4. Phone number I then wanted to dump this data into a Google sheet I am getting an error message when entering a phone number. Screen shots attached. Also, here is code I used submit user data to external api: workflow.makeSuccess = false const leadData = { userStatezip: workflow.userStateZip, name: workflow.userName, email: workflow.userEmail, phoneNumber: workflow.userPhoneNumber } try { const response = await axios.post('https://hook.us2.make.com/5aejcddvcvwmhkr2dh558jun5rj1jsgn', leadData) workflow.makeSuccess = true } catch (error) { console.error(error) } Thank you in advance, Please spoon feed me assistance, if you just tell me " your flux capacitor needs to be tweaked" also tell me where to find it. 🙂 https://cdn.discordapp.com/attachments/1398883444683182143/1398883445001814097/BotpressHelp1.PNG?ex=6886fb3b&is=6885a9bb&hm=7e0d6d58175371138feb90dd94d5177e01fc98b7e47a2a04636a4a63f5abc228& https://cdn.discordapp.com/attachments/1398883444683182143/1398883445454803024/BotpressHelp2.PNG?ex=6886fb3b&is=6885a9bb&hm=72f505c1bd835443d93d19752db63ec9ef001d14968d0305e0989830f53e9474& https://cdn.discordapp.com/attachments/1398883444683182143/1398883445727563777/BotpressHelp3.PNG?ex=6886fb3b&is=6885a9bb&hm=bd3358efea58940edc901614b98f5cf30b7b7bfa73837ec164ab0bed5ae66d2b& https://cdn.discordapp.com/attachments/1398883444683182143/1398883446218293249/BotpressHelp4.PNG?ex=6886fb3b&is=6885a9bb&hm=dd60d5d30c8c0e0d1818488c78ae0c8c494063eeff34263c0bd26d5bc066d23b& https://cdn.discordapp.com/attachments/1398883444683182143/1398883446499049492/BotpressHelp5.PNG?ex=6886fb3b&is=6885a9bb&hm=765c182c1995042950bb68cfa7de5dc4a3ff8faa0b32dfe288212d3c84dc672e& https://cdn.discordapp.com/attachments/1398883444683182143/1398883446864220281/BotpressHelp6.PNG?ex=6886fb3b&is=6885a9bb&hm=bd8787c8acbfb477002741841b3aee57f90e30a8090a4928f5102ca71e1b439c&
r
const apiUrl = "//yourapi"; const requestBody = { client_id: workflow.userId, session_id: conversation.sessionId, order_id: conversation.orderId, table_id: workflow.tableId, // ✅ Include table ID in the request items: workflow.preparedOrder }; console.log(
🔄 Sending request to API: ${JSON.stringify(requestBody)}
); // ✅ Send API request using
await
to ensure response is captured before moving forward const response = await fetch(apiUrl, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify(requestBody) }); // ✅ Ensure we await the response JSON parsing const responseData = await response.json(); console.log(
📩 Response from API: ${JSON.stringify(responseData)}
);
Try adapting a similar structure as this one is working for me also keep in mind for future to add console logs to find errors more easily.
q
Thank you Shantanu for your assistance.
p
Your variables in the execute code card seem to not be properly defined or mispelled. You might want to validate they exist in your workflow in the bottom left side of the studio. Hope this helps!
4 Views