This article helps us to understand how can we leverage Apex Wrapper Class to store the Article Answer selected by the end user in a Bot Conversation.
The Answer Selected Result Object has a different structure so you won't be able to pass it to the apex class and map to Knowledge__kav object.
The structure of Answer Selected Result Object is as follow:
{
"question": "abc",
"answer": "test",
"confidence": 0.817549,
"id": "kaQ1q0000008OJXEA2",
"title": "test",
"type": "FAQ"
}
Below is an example which explains the creation of object and passing the selected variable to the apex class :
Create a class example;
public class objectArt {
public string question;
public string answer;
public double confidence;
public string id;
public string title;
public string type;
}
and then use this object in an invocable variable example:
public class Requests {
@InvocableVariable(label='Records for Input' description='yourDescription' required=true)
public objectArt article;
}
and the Answer Selected Result object will be mapped Successfully and you can able access the id of the knowledge selected.
The invocable method should accept this invocable variable as input for example,
@InvocableMethod(label='Get article')
public static List<Results> getSkillId(List<Requests> sobj) {....}
Please review these relevant help articles:
Einstein Bots System Limitations(Apex action time limit - 10 seconds)
003789771

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.