I'm trying to put in place a screen flow component in order to display knowledge articles based on the case fields and Knowledge-articles data category.
In order to do so, I've created an apex class that I use to query for my KnowledgeArticleVersion that I will be using in my flow.
Here's my Apex Class:
public class KnowledgeArticleLookup {
public static List<KnowledgeArticleVersion> getMyArticles (){
string varType1;
string varType2;
List<KnowledgeArticleVersion> Articles = new List<KnowledgeArticleVersion>();
if(varType1 == 'Global Info'){
If(varType2 == 'Location'){
Articles = [SELECT Id,Title FROM KnowledgeArticleVersion WHERE PublishStatus='online' with DATA CATEGORY Global_Knowledge__c AT Location__c];
}
}
return Articles;
}
Knowing that vartype1 and vartype2 are values used in my flow ( in a get element), I was wondering how I can pass these two variables to my apex class and how I can pass my Articles(list) to my Flow.