---
title: "PCF - Single Select"
canonical: "https://support.appfire.com/space/PSJ/1589019720/PCF%20-%20Single%20Select"
format: markdown
---
> Macro (aura-html)

> Macro (button-handy)



---

## Examples

| **Example** | **Sample script** | **Sample display output** |
| --- | --- | --- |
| Using PCF - Single Select with SIL data source | This script retrieves all versions from the "TEST" project and adds them as options to the custom field.<br>```
string projectKey = "TEST";
string[] versionNames = admGetProjectVersions(projectKey);
number[] versionId;
for(string versionName in versionNames){
    JVersion version = admGetProjectVersion(projectKey, versionName); 
    versionId += version.id;
}
return versionId;
``` | "Version 1.0 (10001)"  
"Version 2.0 (10002)"  
"Version 3.0 (10003)" |
| Using PCF - Single Select with SQL data source | This query retrieves all version names and IDs from the database.<br>> ℹ️ Before using SQL data source, ensure you've configured the JNDI settings as detailed in the [SQL data source documentation](https://appfire.atlassian.net/wiki/spaces/PSJ/pages/1589019609).<br>```
select vname, id from projectversion;
``` | "Version 1.0 (10001)"  
"Version 2.0 (10002)"  
"Version 3.0 (10003)" |