what are all the ways you can capture specific inf...
# 🤝help
a
I am trying to figure out how to capture information in specific variables so i can log the data of what poeple said.
s
Yea, i dont underste understand i cant find any documentation on this
can you give an example on how that execute card need to be set up?
r
What do you want to do with the data? I'm not sure what "log the data" means.
s
"Forward" it. See, i try to set up det bot to get the user to provide his e-mail adress to get access to a ebook. Once the e-mail adresse is provided, i would like to be notified. I dont care how, ive tried to setup a webhook to discord to retived the "logged" data from the variable witout any Luck🥲
r
That is mostly done with either make.com or zapier.com. In Make it would look something like this (Zapier would be almost identical I think, but I'm not sure): const makeApiUrl = 'https://hook.us1.make.com/put-your-make-url-here' const payload = { fname: user.fname, lname: user.lname, email: user.email, phone: user.phone, interests: '' } await axios.post(makeApiUrl, payload)
This is what the execute card would look like.
s
yea, it looks like different version i've tried, it gives me "cannot send empty message" when I use a code like that, perhaps its my understanding of variables in botpress that is not on par with my technical knowledge
r
In my example I am using "user" variables. If you are not using user variables (which will save from one session to another for the user) you can use workflow.variablename to get the workflow variables. (Note you may have to split out the first and last name.)

https://cdn.discordapp.com/attachments/1130550341994299533/1133116517085618297/image.png

https://cdn.discordapp.com/attachments/1130550341994299533/1133116517324701717/image.png

https://cdn.discordapp.com/attachments/1130550341994299533/1133116517593120939/image.png

s
Thanks a ton for your time❤, ill try with make once i get to the pc
const payload = { email: workflow.eMail } try {const respone = await axios.post('https://hooks.zapier.com/hooks/', payload) } catch (wrror) {console.log(error)}
got it to work with this and zapier
thanks a lot mate, really appriciate
r
Cool 🙂
c
Thanks so much @rich-oxygen-43707 💖 !