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

> Macro (button-handy)



---

## Examples

| **Example** | **Sample script** | **Sample display output** |
| --- | --- | --- |
| Using PCF - Checkbox with SIL data source | This script retrieves all components from the "TEST" project and adds them as options to a custom field that uses this script as its data source.<br>```
string projectKey = "TEST";
string[] componentNames = admGetProjectComponents(projectKey);
number[] componentId;
for(string componentName in componentNames){
    JComponent componentNames = admGetProjectComponent(projectKey, componentName); 
    componentId += componentNames.id;
}
return componentId;
``` | "Backend Component (1001)"  
"Frontend Component (1002)"  
"Database Component (1003)" |
| Using PCF - Checkbox with SQL data source | This query retrieves all component names 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 cname, id from component;
``` | "Backend Component (1001)"  
"Frontend Component (1002)"  
"Database Component (1003)" |