[Error]: data/text must NOT have fewer than 1 char...
# 🤝help
e
I've just sent the report with the below id: report_01HYFZ89FD7SFNGR7CJMV6TDX1 Hello, when i test my bot in development phase (botpress studio) everything works perfect. But when i go to Chat tab or integrate it on messenger or whatsapp it keeps giving the below issue: Error sending outgoing message { integration: 'webchat', messageType: 'text', payload: '{"type":"text","text":"","typing":true}', error: Ot [Error]: data/text must NOT have fewer than 1 characters at Ec (/var/task/customer_code.js:11:81636) at Qt (/var/task/customer_code.js:11:81458) at v (/var/task/customer_code.js:11:94882) at /var/task/customer_code.js:11:83436 at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async Object.flushSendMessages (/var/task/customer_code.js:1120:12899) at async runDialogEngine (/var/task/customer_code.js:1141:4487) at async startEventProcessing (/var/task/customer_code.js:1141:4299) at async /var/task/customer_code.js:1141:13707 at async /var/task/customer_code.js:304:170 { isApiError: true, code: 400, description: "The provided data doesn't respect the provided JSON schema.", type: 'InvalidDataFormat', error: undefined, id: 'err_20240522104438xA8ACE2CF' } } this is a killing issue since the only solution i have so far is to delete the bot and make another one with the same template!! and this makes me redo the integration steps with the social media channels again and again for my clients which is impossible to be sustained!!!! just called our api and returned the response in a variable. then showed it in a text box with the variable
f
Hey there, It's probably because you have an empty field for the question to ask the user in a capture information card, like the single choice card.
e
I know that but why it's doing that? The api call in the studio is all good and working, but out in integrations it's giving that error!!!
f
The error code states that 🙂
e
You are right, but that's not logic as it works well in Studio!!!
f
I can only make an educated guess. Maybe its better that someone from the team explain it.
f
Not sure how your flow works or what information you are trying to capture without asking a question but maybe try using "wait for user input" card?
e
i'm getting the user message from event.preview then passing it to my endpoint and the response content returned is sent as a text variable
f
Was it an empty single choice card, or raw input card, or was it another card?
f
Thank you. You can add an expression card, right before it that checks if its empty. If it is, then transition to another node that handles failure.
e
that's great, however it can't be failed and i pass it, the core is in doing the call and getting the response
f
workflow.response was empty, that is what I meant with failure
e
as you can see, the workflow.response is the one having the ai response from our server, it can't be empty and that's right in studio. However for the integrations it gets empty, given that i've published multiple times https://cdn.discordapp.com/attachments/1242794503404912721/1242838832605302967/image.png?ex=664f4b5c&is=664df9dc&hm=1c28169c33bf22cbd2e17dbdc5f6f2ea5bb917b8b846a23860e50ade2b44436f&
f
You should be able to check the logs right before the error with the "Fewer than 1 characters". It would show the console.log that you made, and if its empty or not.
e
It's empty in logs, however when i run in studio it returns all good, the issue is out of studio
f
Console.log the error
e
@limited-pencil-78283 any thoughts here?
l
In this, can you share the payload passed to axios.post?
I am guessing it has this payload: '{"type":"text","text":"","typing":true}', and something is missing can you do a console.log of the payload and comment the axios.post to see the output in logs
e
sure will do and get back
l
also, what is passing value to "text":"" the empty variable check that as well
55 Views