SIL Data Source

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:

  1. Selecting the SIL Data Source type.

  2. Choosing a SIL script from your scripts repository.

 

This screenshot shows SIL Data Source selected on the Data Source section of the custom field configuration page.
Configure SIL Data Source section on the custom field configuration page

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

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

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

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

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"]).

 

Need support? Create a request with our support team.

Copyright © 2005 - 2025 Appfire | All rights reserved.