Raw / Single Choice not working
# 🤝help
@fresh-fireman-491 can you help, I am not sure why
f
I would love to. Can you try using {{}} instead of @
same May 9, 2024, 9:15:34 PM [2f3ce0ccd5] [bot-action] [flow:GetCalendar] [node:Standard] [card:Generate suggested dates in a specific format for the user.]: Dates 09 May, 10 May, 11 May, 12 May, 13 May May 9, 2024, 9:15:34 PM [2f3ce0ccd5] [dm] : [Capture] Start information capture May 9, 2024, 9:15:34 PM [2f3ce0ccd5] [dm] : Sending Message. Type: choice. Text: Please select a date May 9, 2024, 9:15:34 PM [2f3ce0ccd5] [dm] : Waiting for user input
It says Sending Message but nothing is sent
b
it's expecting an array type
try saving the initial input as an array, not a string
l
Hey @bumpy-butcher-41910 It is an array
Copy code
const currentDate = luxon.DateTime.now().setZone('IST')
const suggestedDates = []

for (let i = 0; i < 5; i++) {
  const date = currentDate.plus({ days: i })
  const formattedDate = date.toFormat('dd LLLL') // Change the format to show date in numbers and month in text
  suggestedDates.push(formattedDate)
}

workflow.suggestedDatestoUser = suggestedDates
console.log("Dates ", workflow.suggestedDatestoUser)
b
hmm
let me test this out~
l
this is the ouput from console.log Dates 09 May, 10 May, 11 May, 12 May, 13 May
I found something
Copy code
[whatsapp] Failed to send interactive message from bot to Whatsapp. Reason: {
  message: "Unsupported post request. Object with ID '278695938650087' does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api",
  type: 'GraphMethodException',
  code: 100,
  error_subcode: 33,
  fbtrace_id: 'A49jEpEDp7CshSkCbzSSzBM'
}
I cannot recognize this 278695938650087 object id
this log is immediate after [2f3ce0ccd5] [dm] : Waiting for user input
b
I can't comment on the meta part of this, but your variable isn't selecting an object in the array
however I'm testing this out myself and it doesn't seem to be liking my selected object lol
so I'm taking a gander
l
"Failed to send interactive message from bot to Whatsapp" is from BotPress to Whatsapp. Since it is not part of my code, I am not sure from where is bot sending that message and where is the object id picked up from? There is no custom whatsapp message I have written in this workflow
this is picked up as an object [0]
b
hmm
l
I have 5 objects 09 May, 10 May, 11 May, 12 May, 13 May
hence the correct way to type @workflow.suggestedDatestoUser
my problem is not that it wont show me the dates as selection. it is not displaying the card
f
Variable type should be an array. Type should be options and not string. Can you confirm that it is?
l
i have always used string and it has worked, I will try options
will keep you posted
f
👍🛠️
l
It is working after importing the export to a new bot
f
Oh okay, nice
3 Views