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
Bill Bell 3Bill Bell 3 

Is it Possible to Have Invocablevariable Picklist

I doubt this is possible but I want to check.  I created an Invocablemethod and I have several Invocablevariables that are required.  I would like one Invocablevariable to be a picklist.  I tried enum but it didn't like it.  I currently define it as a String but it very tedious to make sure I type the proper value correctly.  DayType needs to be a picklist.
 
global class CreateTaskRequest {
    @InvocableVariable(required=true)
    global Id OppId;
  
    @InvocableVariable(required=true)
    global String Subject; 
    
    @InvocableVariable(required=true)
    global Id OwnerId;

    @InvocableVariable(required=true)
    global Date ReferenceDate; 
    
    @InvocableVariable(required=true)
    global Integer Days; 
    
    @InvocableVariable(required=true)
    global String DayType; 
}

 
jessmin joejessmin joe
You then can pass back a List of this class. There's a good example of this on the InvocableVariable doc page. Here's another example: https://now-gg-gta5.info/