Printing time and date of chatbot input on Sheets
# šŸ¤help
p
Hey guys, I’m currently building a chatbot that captures customer info (email, phone number etc) onto Google Sheets via Zapier. I’ve successfully done it but I can’t get the date and time of the customer’s input onto the Google Sheets. Would appreciate some help and advice.
r
create a field in your sheet for the date and then you can put: =TEXT(NOW(),"dd/mm/yyyy hh:mm") in your field value in zapier for the field you just created. This should pass the date as a static value.
f
This is what I use in my bot : const A = Date.now(); const date = new Date(A); ChatStartTime = `${date.getFullYear()}${date.getMonth() + 1}${date.getDate()}${date.getHours()}${date.getMinutes()}${date.getSeconds()}`;
will output : 202373017164
YYYYMMDDHHMMSS
b
great!!, but, the output only shows 12 digits is that correct?
p
Do you add these as "Execute code"? And also, with this do I need to use Zapier to capture the output of these as well?
Thanks for the reply, but that's not what I'm looking for, because the time will reset to CURRENT time, which is not what I'm looking for. I'm looking to capture the exact time of the input that was typed into the chatbot, so the appointment setter knows exactly when did the customer "spoke" to the chatbot.
https://www.youtube.com/shorts/G8pZyPuGlOY Found out the solution here if anyone wants to refer
f
Yes, run the code in an Execute code thing. So your timestamp will be in var date. You can then use it in your flow(s) or send it to Google sheets etc... you just have to write the var containing your timestamp somewhere . Hope this helps.