---
title: "SIL Data Source"
canonical: "https://support.appfire.com/space/PSJ/1589019574/SIL%20Data%20Source"
format: markdown
---
> Macro (aura-html)

> Macro (button-handy)



> ℹ️ For detailed instructions, see  [Add and configure a new Power custom field](https://appfire.atlassian.net/wiki/spaces/PSJ/pages/1589019449).

The script you selected for your SIL data source retrieves and displays values in your custom fields based on your defined criteria.

---

## SIL script parameters and return types

These reference tables show script parameters and return types you can use in creating your SIL scripts. Parameters (`argv`) define what information your script can access, while return types determine how your data is stored and displayed.

### Search Parameter

| **Parameter** | **Description** | **Syntax** |
| --- | --- | --- |
| query | User's typed text for filtering options | `argv["query"] ` |

### Field Information Parameters

> 📝 Available with Power Custom Fields version 6.2.820.6 and later.

| **Parameter** | **Description** | **Syntax** |
| --- | --- | --- |
| cfid | The custom field ID (customfield_XXXXX) | `argv["cfid"] ` |
| cfname | The custom field name | `argv["cfname"] ` |
| fieldconfigid | The ID of the field's configuration (XXXXX) | `argv["fieldconfigid"] ` |
| fieldconfigname | The name of the field's configuration | `argv["fieldconfigname"] ` |

### Return Types

| **Type** | **Description** | **Example** | **Usage** |
| --- | --- | --- | --- |
| `string[]` | Returns a simple array of strings. Each string is automatically paired as (value, value). | ["Red"] becomes (Red, Red) | Basic data source scripts. |
| `KPOption[]` | Returns an array of KPOption objects. Each KPOption has a label (display) and value (stored). | KPOption("Red", "R") | Required when using `argv["query"]` for filtering. |

> 📝 When implementing filtering with `argv["query"]`, your script must return an array of KPOption objects.

#### KPOption Structure

Here's the KPOption structure as a table and in code format:

| **Property** | **Type** | **Description** |
| --- | --- | --- |
| label | `string` | Display text |
| value | `string` | Stored value |

##### KPOption Structure syntax

```
KPOption {
    label: string   // Display text
    value: string   // Stored value
}
```

### Example Script

```
string [] issues = selectIssues("created < now()"); 
string [] res; 
for (string iss in issues) { 
    if (contains(iss.summary, argv["query"])) { 
        res = addElementIfNotExist(res, iss); 
    } 
} 
return res;
```

This script filters issues by searching their summaries. It gets all previously created issues and returns those containing the user's search text (accessed through `argv["query"]`).