limited-pencil-78283
04/15/2024, 9:36 AM[whatsapp] Received list reply from Whatsapp: { id: '4', title: 'Breakfast', description: 'Breakfast Healthy Meal' }
Using Raw Input, I do not get a choice to extract id, it by default extracts title
Field validation successful! Extracted: "breakfast". Input: 4
Any suggestions?square-toddler-30705
04/15/2024, 10:31 AMlimited-pencil-78283
04/15/2024, 11:41 AM[whatsapp] Received list reply from Whatsapp: {
id: '1',
title: 'Jumbo Meal',
description: 'Jumbo Meal for Lunch and Dinner'
}
[bbf13878b8] [dm] : Message of type text received from user_01HV6XVCSMZCZD0C7MRM5SYEZH on whatsapp
[bbf13878b8] [agent-hook] [KnowledgeAgent] [conversation_turn_started]: Skipping KB: disabled for the current turn
[bbf13878b8] [bot-hook] [after_incoming_middleware] [Tokens]: Executing hook
[bbf13878b8] [dm] : [Capture] User provided a value:
[bbf13878b8] [dm] : [Capture] Transformed the extracted value
[bbf13878b8] [dm] : [Capture] Prompt success
[bbf13878b8] [dm] : [Capture] Field validation successful! Extracted: ["lunch",1]. Input: 1
square-toddler-30705
04/15/2024, 11:44 AMsquare-toddler-30705
04/15/2024, 11:44 AMlimited-pencil-78283
04/15/2024, 11:52 AMconst mealMenu = {
purpose: 'sendmessage',
message_data: {
messaging_product: 'whatsapp',
recipient_type: 'individual',
to: user.phoneNumber,
type: 'interactive',
interactive: {
type: 'list',
header: {
type: 'text',
text: 'ATM Tiffins'
},
body: {
text: 'Choose from Breakfast, Lunch or Dinner'
},
action: {
button: 'Select Meal',
sections: [
{
title: 'Choose',
rows: [{
id: meal.id,
title: meal.name,
description: meal.description
}
]
}
]
}
}
}
}
It gives users a Single Choice Card, from where the user selects an option
However, since this is not a standard Botpress Single Choice Card used, it only shows the user selection in the logs.
To handle it, I am using a raw input card retrieved from history to extract the received response and hence the whole problem
https://cdn.discordapp.com/attachments/1229364809179467818/1229398986763538563/image.png?ex=662f8a07&is=661d1507&hm=79cfe25d2949f064438c3332bf584fa5480d946a9c9ae022a0ace1420e74ac10&limited-pencil-78283
04/15/2024, 11:53 AMlimited-pencil-78283
04/15/2024, 11:53 AMlimited-pencil-78283
04/15/2024, 11:59 AMsquare-toddler-30705
04/15/2024, 12:00 PMlimited-pencil-78283
04/15/2024, 12:01 PMfresh-fireman-491
04/15/2024, 12:01 PMlimited-pencil-78283
04/15/2024, 12:02 PMlimited-pencil-78283
04/15/2024, 12:02 PMlimited-pencil-78283
04/15/2024, 12:05 PMlimited-pencil-78283
04/15/2024, 12:05 PMlimited-pencil-78283
04/15/2024, 12:08 PMlimited-pencil-78283
04/15/2024, 12:09 PMfresh-fireman-491
04/15/2024, 12:19 PMlimited-pencil-78283
04/15/2024, 12:25 PMlimited-pencil-78283
04/15/2024, 1:21 PMwhatsapp] Handler received request from Whatsapp with payload: {"object":"whatsapp_business_account","entry":[{"id":"302242106299282","changes":[{"value":{"messaging_product":"whatsapp","metadata":{"display_phone_number":"918660829530","phone_number_id":"293125593881024"},"contacts":[{"profile":{"name":"Lijo Mathew"},"wa_id":"919741391700"}],"messages":[{"context":{"from":"918660829530","id":"wamid.HBgMOTE5NzQxMzkxNzAwFQIAERgSN0NGM0U1Q0E0ODYyMEM5MTE4AA=="},"from":"919741391700","id":"wamid.HBgMOTE5NzQxMzkxNzAwFQIAEhggQkUwNzc4NzI2QzdBQTk1MEIyQzFFRDNCRjQyRjBCQzYA","timestamp":"1713186940","type":"interactive","interactive":{"type":"list_reply","list_reply":{"id":"4","title":"Breakfast","description":"Breakfast Healthy Meal"}}}]},"field":"messages"}]}]}
[whatsapp] Received list reply from Whatsapp: { id: '4', title: 'Breakfast', description: 'Breakfast Healthy Meal' }
extract history 1 level gives me and array like [breakfast, 4], etc. However, extract history 2 levels, gives me just 4limited-pencil-78283
04/15/2024, 1:21 PMlimited-pencil-78283
04/15/2024, 3:15 PMfresh-fireman-491
04/15/2024, 3:24 PMlimited-pencil-78283
04/24/2024, 11:24 AMsquare-toddler-30705
04/24/2024, 5:07 PMlimited-pencil-78283
04/25/2024, 8:00 AMsquare-toddler-30705
04/25/2024, 8:01 AMsquare-toddler-30705
04/25/2024, 8:01 AMlimited-pencil-78283
04/25/2024, 8:02 AMsquare-toddler-30705
04/25/2024, 8:04 AMfamous-jewelry-85388
04/25/2024, 4:27 PMfamous-jewelry-85388
04/25/2024, 4:27 PMlimited-pencil-78283
04/25/2024, 4:29 PMlimited-pencil-78283
04/25/2024, 4:29 PMfamous-jewelry-85388
04/25/2024, 4:31 PMlimited-pencil-78283
04/25/2024, 4:31 PMlimited-pencil-78283
04/25/2024, 4:31 PMlimited-pencil-78283
04/25/2024, 4:33 PMlimited-pencil-78283
04/25/2024, 4:34 PMfamous-jewelry-85388
04/25/2024, 4:34 PMfamous-jewelry-85388
04/25/2024, 4:35 PMfamous-jewelry-85388
04/25/2024, 4:35 PMlimited-pencil-78283
04/25/2024, 4:35 PMlimited-pencil-78283
04/25/2024, 4:37 PMlimited-pencil-78283
04/25/2024, 4:39 PMfamous-jewelry-85388
04/25/2024, 4:46 PM