We use cookies to make HubSpot's community a better place. Cookies help to provide a more personalized experience and relevant advertising for you, and web analytics for us. To learn more, and to see a full list of cookies we use, check out our Cookie Policy (baked goods not included).
May 20, 2021 4:43 AM - edited May 20, 2021 4:44 AM
Hello everyone,
I'm currently working on a product registration with the help of the chatbot and have a little script problem that I don't understand:
I have a bot script, which in the first step fetches the necessary contact data from the CRM, then creates a deal and finally assigns this deal to the contact.
All information is stored in an object and should be transferred via customState so that the data can be used further on.
There are 3 nested requests to the API for this purpose (contact-search, create-deal, assoc-deal-to-contact). All requests are carried out successfully and the corresponding step is listed as "success" in the log.
Now to the problem: The bot does not output the message and does not pass the customState, so that I cannot continue working with the object data.
For one reason: customState can only have one level. It seems that multilevel objects are not processed. And all of this without an error message. The output is simply ignored.
Any thoughts?
That's the return from the log:
{
"botMessage": "Fast geschafft! Ich stelle dir nur noch ein paar Fragen zum Kauf deines Antriebs!",
"customState": {
"regEntry": {
"deal": {
"id": "5304365212",
"amount": "0",
"dealname": "John Doe",
"pipeline": "13721419",
"dealstage": "13721421"
},
"assocs": {
"companyToDeal": 0,
"contactToDeal": "123456789",
"lineItemToDeal": 0
},
"company": {
"id": 0,
"name": "",
"domain": ""
},
"contact": {
"id": "123",
"zip": "12345",
"city": "Musterstadt",
"email": "email@example.de",
"address": "1 Testallee",
"country": "Deutschland",
"lastname": "Doe",
"firstname": "John"
},
"line_item": {
"id": 0,
"name": "",
"amount": "",
"searlno": "",
"product_id": 0
}
}
},
"responseExpected": false
}
May 20, 2021 10:20 AM