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
Ceejay Quach 2Ceejay Quach 2 

Einstein Bot Builder- Output Invocation Mapping

Hello!

Does anyone know how to create an Apex method with an output invocation mapping? Or where I can find resources regarding this?
(Error: An operation invocation must contain at least 1 output invocation mapping)

User-added image

Thanks,
Ceejay
Prashant Kumar 302Prashant Kumar 302
Hi Ceejay,

Were you able to resolve this issue? I'm trying to create a basic bot but I'm unable to fix this error.

Thanks & Regards,
Prashant
Anbu Thiagarajan 10Anbu Thiagarajan 10
Use return type list<list<sObject>> instead of list<sObject> in your invocable class
Priyank Singh 8Priyank Singh 8
Are you able to resolve this issue ??  I am also gettting the same error, not showing the output while adding this class. 
public with sharing class GetServiceTagValidation {
public class ServicetagOutput{
@InvocableVariable(required=true)
public String sServiceTagValidated;
}
public class ServicetagInput{
@InvocableVariable(required=true)
public String sServiceTag;
}
@InvocableMethod(label='Validate Service Tag')
public static List<ServicetagOutput> getOrderStatus(List<ServicetagInput> servicetagInputs)
{
Set<String> servicetagnumber = new Set<String>();
for (ServicetagInput servicetagInput : servicetagInputs)
servicetagnumber.add(servicetagInput.sServiceTag);
Map<String, String> mapNameStatus = new Map<String, String>();
List<Asset> orders = [SELECT Name, Kb__c FROM Asset where Name in :servicetagnumber ];
if (orders.size()>0)
{
for (Asset order : orders)
mapNameStatus.put(order.Name, order.Kb__c);
}

List<ServicetagOutput> servicetagOutputs = new List<ServicetagOutput>();
for (ServicetagInput servicetagInput : servicetagInputs)
{
ServicetagOutput servicetagOutput = new ServicetagOutput();
servicetagOutput.sServiceTagValidated = mapNameStatus.get(servicetagInput.sServiceTag);
servicetagOutputs.add(servicetagOutput);
    system.debug('checking'+servicetagOutputs);
}
return servicetagOutputs;
}
}
While the same class is working when we are using with "Action" . While popping error for "Question".