Issue with input query:
# 🤝help
f
I'm having Issues with Stack Ai because the input wont go in the query. I provided some screenshots and I'd be very happy if someone is able to help me out!

https://cdn.discordapp.com/attachments/1135559431845855282/1135559432017825924/image.png

https://cdn.discordapp.com/attachments/1135559431845855282/1135559432261079080/image.png

a
Hi @freezing-art-73495 , we don't support Stack Ai, but we can help on the Botpress side. This is how I would troubleshoot the issue. 1) create a "fixed" (set the variable yourself so you can test it manually) execute code at the beginning of the conversation (if you haven't already) that calls your api with some data. In my case, I used execute code to generate some dummy code for google.com using this label : "call https://google.com via axios. send {foo:bar} as a payload" 2) link up the start node with the execute code somehow (I put it it in it's own node). 3) say something to your bot. 4) click your message 5) on the bottom, a panel will display your execute code. Click that to open the information. 6) You should see all the information that is being sent to the api, along with the response code from the api. 2xx codes mean success, and 4xx mean failure. 7) make sure that the api endpoint / URL is correct 8) make sure that the data is being sent correctly. In my case it would look like :
Copy code
Request:
foo:"bar"

https://cdn.discordapp.com/attachments/1135559431845855282/1135563734081875968/image.png

https://cdn.discordapp.com/attachments/1135559431845855282/1135563734308376626/image.png

https://cdn.discordapp.com/attachments/1135559431845855282/1135563734585180261/image.png

https://cdn.discordapp.com/attachments/1135559431845855282/1135563734824267847/image.png

f
Thanks Patrick!
f
Hi I am running a query to read a spreadsheet find some simple data and then read it back in. I am using Make. The webhook works fine (axios url & payload) so i finds the data and then attempts to send it back. It appears to send exactly what I want back. I think my problem is getting the data out of Axios response variable. I have tried many variations and looking through here I was prompted to try the JSON format, but all I seem to get is the word Accepted as the output. This is what I have: const jsonArray = response.data console.log(JSON.stringify(jsonArray)) env.outputArray = JSON.stringify(jsonArray)
OK I found a possible solution. The data must be returned in the body for it to be saved as env.outputArray, and then as it is just a few bits of data I can get what I want using javascript split - a bit ham fisted. I realise you don't support Make, but I still need to know how to read bigger chunks of data - like a user history, as json. So we can say [customer] bought [product] [count] times and has earned a 50% discount. Then I can make up a random code and store it to her account so only she can redeem it. I am using google sheets.