I have an apex class that returns a list of records/response as an output.
public class KnowledgeArticleLookup {
@InvocableMethod(label='Get Knowledge Articles' description='Gets knowledge article results')
public static List<List<Response>> getMyArticles (List<Request> req){
List<KnowledgeArticleVersion> Articles = new List<KnowledgeArticleVersion>();
if(req[0].varType1 == 'Global Info'){
if(req[0].varType2 == 'Location'){
articles = [SELECT Id,
Title
FROM KnowledgeArticleVersion
WHERE PublishStatus='online'
WITH DATA CATEGORY
Global_Knowledge__c AT Location__c];
}
}
List<List<Response>> outputResponse = new List<List<Response>>();
List<Response> responses = new List<Response>();
for(KnowledgeArticleVersion kav: articles) {
Response response = new Response();
response.articleversionId = kav.Id;
response.articleTitle = kav.Title;
responses.add(response);
}
outputResponse.add(responses);
return outputResponse;
}
public class Request {
@InvocableVariable(required=true)
public String varType1;
@InvocableVariable(required=true)
public String varType2;
}
public class Response {
@InvocableVariable
public String articleversionId;
@InvocableVariable
public String articleTitle;
}
}
when I debug my flow, my apex class returns the result as follow:
I was wondering how I can assign my articleversionId to a flow collection variable, knowing that my flow apex action doesn't give me the possibility to store my output variable (screenshot below).
global List<String> articleVersionId