SIL Data Source
SIL data source lets you use SIL scripts to populate custom fields with data from multiple sources, such as databases (for example, using the sql function), files, or legacy systems.
Configuring a SIL data source involves two steps:
Selecting the SIL Data Source type.
Choosing a SIL script from your scripts repository.
Contents: |
|---|
For detailed instructions, see Add and configure a new Power custom field.
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 |
|
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) |
|
cfname | The custom field name |
|
fieldconfigid | The ID of the field's configuration (XXXXX) |
|
fieldconfigname | The name of the field's configuration |
|
Return Types
Type | Description | Example | Usage |
|---|---|---|---|
| Returns a simple array of strings. Each string is automatically paired as (value, value). | ["Red"] becomes (Red, Red) | Basic data source scripts. |
| Returns an array of KPOption objects. Each KPOption has a label (display) and value (stored). | KPOption("Red", "R") | Required when using |
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 |
| Display text |
value |
| 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"]).
Need support? Create a request with our support team.
Copyright © 2005 - 2025 Appfire | All rights reserved.
