---
schema_version: "1"
id: bb17146fb33a60eb9769cc1aeee4ae20aa516b00d166d8ab9044d766878232e4
title: Populating Picklist Values in Omniscript Inputs from Apex
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/xcloud/264-0-0/os_populating_picklist_values_from_apex_21650.md
canonical_url: https://help.salesforce.com/s/articleView?id=xcloud.os_populating_picklist_values_from_apex_21650.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 31ab854cee4d2de7a7fbc3958bd29cb0cc88f8c52cc60559106ee895019e27d5
description: You can populate Select, Multi-select, and Radio elements from a Callable Apex class. The values for the element are obtained during the Omniscript's activation.
products:
  - Omnistudio
release: "264"
---
# Populating Picklist Values in Omniscript Inputs from Apex

You can populate Select, Multi-select, and Radio elements from a Callable Apex class. The values for the element are obtained during the Omniscript's activation.

To populate a picklist from an Apex class, make sure to enable **Get picklist values when the Omniscript loads** for the Omniscript from Setup. For the designer on a managed package, enable **Fetch Picklist Values at Script Load**.

To populate the options of an element, a `List<Map<String, String>>` is returned from the Apex class. The Map Options are **Name**, the Language Independent Option, and **Value**, the UI Display value.

Sample Apex Code for Populating a Picklist:

```
global with sharing class SelectOptionsCallable implements Callable
{
   global Object call(String action, Map<String, Object> args)
   {
       switch on action {
           when 'SelectOptions' {
               return SelectOptions((Map<String, Object>)args.get('input'), (Map<String, Object>)args.get('output'));
           }
       }
       return null;
    }
   
    private List<Map<String, Object>> SelectOptions(Map<String, Object> inputMap, Map<String, Object> outMap)
    {
        List<Map<String, Object>> optionList = new List<Map<String, Object>>();
        for (Account acc : [ Select Id, Name from Account limit 8])
        {
             Map<String, Object> option = new Map<String, Object>();
             option.put('name', acc.Id);
             option.put('value', acc.Name);
             optionList.add(option);
        }
        
        outMap.put('options', optionList);
                
        return optionList;
    }
}
```

For information on populating dependent picklists, see [Populating Dependent Picklist Values in Omniscript Inputs with Apex](https://help.salesforce.com/s/articleView?id=xcloud.os_populating_dependent_picklist_values_with_apex_21668.htm&release=264.0.0&type=5 "You can populate Select, Multi-select, and Radio elements from a Callable implementation. The values for the element are obtained during the Omniscript's activation.").