I am receiving data from an external api in apex class. I am using a wrapper class to pass this data to salesforce screen flow. In debug the flow is showing that it receives data from the apex class. How can I convert this data to a collection variable to show in flow data table. In data table I tried to create new resource and tried to assign Apex defined variable but whenever I checked Multiple Values the data table just rejects it and no resource is shown in the resource. This is the data I am trying to show in data table.
{
"Product_Catagories": [{
"id": "8ad08aef8534de220185400383d82def",
"name": "Product One",
"description": "Desc One",
"region": "",
"category": "Main Products",
"ProductFamily": "Main",
"RelatedProducts": "POC-B0000001",
"productfeatures": []
}, {
"id": "8ad0887e8534de2701853fff5a9b22ee",
"name": "Product Two",
"description": "Desc Two",
"region": "",
"category": "Main Products",
"ProductFamily": "Main",
"RelatedProducts": "POC-B0000002",
"productfeatures": []
}, {
"id": "8ad08aef8534de2201853ffe48fc08f6",
"name": "Product Three",
"description": "Desc Three",
"region": "",
"category": "Main Products",
"ProductFamily": "Main",
"RelatedProducts": "POC-B0000003",
"productfeatures": []
}]
}
Show some code, not just the message you got.
You're using https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_annotation_InvocableMethod.htm right?
3rd example on that page shows how to return a list of helper class objects,
public static List <Results> execute
. So what you need is something likeThere may even be a code-free way to do it, we don't know what your API is. https://help.salesforce.com/s/articleView?id=sf.flow_http_callout.htm&type=5