function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
vleandrovleandro 

Einstein Chatbot: Create Dynamic Menus

I've been following along in the "Einstein Bots Developer Cookbook" and so far things have gone really well.  However, I hit the section called "Create Dynamic Menus" and can't figure out what's going on. 

I'm using the same code that supplied in the Cookbook.  Here's the code I'm using.
 
public with sharing class CookbookBot_GetOpenAppointments {
    
    @InvocableMethod(label='Get Open Appointments')
    public static List<List<Bot_Appointment__c>> getOpenAppointments(List<String> sEmails) {
        
        String sEmail = sEmails[0]; 
        system.debug('sEmail = ' + sEmail);
        
        // Get the list of new and scheduled appointments
        List<Bot_Appointment__c> appointments = [SELECT Id, Name, JobType__c, AppointmentDate__c, AppointmentSlot__c
                                                FROM Bot_Appointment__c
                                                WHERE Contact__r.Email = :sEmail
                                                AND Status__c IN ('New', 'Scheduled')];
        
        system.debug('Appointments: ' + appointments); 
        
        // Create a list for the appointments
        // NOTE: This is a list of lists in order to handle bulk calls...
        List<List<Bot_Appointment__c>> appointmentList = new List<List<Bot_Appointment__c>>();
        
        // Add all the new and scheduled appointments to the list
        appointmentList.add(appointments);
        
        return appointmentList;
    }
}
I verified that my email address is getting captured correctly.

I also have used Query Editor to verify the SOQL query works correctly from the Developer Console.  The following is from Debug.

SELECT Id, Name, JobType__c, AppointmentDate__c, AppointmentSlot__c FROM Bot_Appointment__c WHERE (Contact__r.Email = :tmpVar1 AND Status__c IN ('New', 'Scheduled'))

However, the system is not finding any records despite the fact when I run the query above in the Developer Console (and replace ":tmpVar1" with my email address) that records are returned. 

What am I missing?  Here's the node in the Bot where Apex is getting called.

User-added image
I added some debug, but again, it seems like the Apex class is not returning any values from the query...which is really odd. 

USER_DEBUG|[15]|DEBUG|Appointments: ()

Thoughts?  Is something missing from the Class?

Thank you for your consideration and help!