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
Øyvind Borgersen 10Øyvind Borgersen 10 

Flow Apex return list to use in picklist

Hi,

I have a scenario where I need to paste one single value from a flow to an apex class and run a query and return the result back to the flow to be used as a picklist choice. The code below does not work sufficiently. Can anyone advice?

public class ProductArrangementCollection {
    @InvocableMethod(Label='Terms' description='Insert Terms value')    
    public static List<ID> FindProductArrangement(List<string> Terms) {
        List<ID> Ids = new List<ID>();
        Product_Arrangement__c c = [Select id from Product_Arrangement__c where Actual_start_date__c = 'Terms' limit 10];
        if(c != null) { 
            Ids.add(c.Id);
        }
        return Ids;
    }
}
SUCHARITA MONDALSUCHARITA MONDAL

Hi Øyvind,

Are you able to get the results from SOQL?

Thanks,
Sucharita

Øyvind Borgersen 10Øyvind Borgersen 10
Hi Sucharita,
Not really, it's not reflecting the variable in the input parameter, but that's another issue.