Documentation Index

Fetch the complete documentation index at: https://help.elaine.io/llms.txt

Use this file to discover all available pages before exploring further.

API reference: Data fields

Prev Next

 API reference: Data fields documents the function signatures, parameters, return values, and error behavior of the Elaine HTTP API.

Note

Function availability depends on the Elaine release and enabled features. Authenticate HTTP requests with an Elaine-issued Bearer JWT.

Function overview

booleanapi_datafieldChangeList ( int $f_id , array $names , array $values )
Modifies the specified list data field with the transferred values.
integerapi_datafieldCreateList ( string $type , string $label , string $location , array $set_labels , array $set_values , bool $hide = false , int $group_id , bool $asynchronous = true , string $description = '' )
Creates a new data field of the type 'select' or 'multiselect'.
integerapi_datafieldCreateSingle ( string $type , string $label , string $location = 'dataset' , bool $hide = false , int $length = 255 , int $group_id , bool $asynchronous = true , string $description = '' )
Creates a new data field of the type 'text', 'textfield', 'int', 'date', 'checkbox'.
booleanapi_datafieldDelete ( int $f_id )
Deletes the given data field.
array|integerapi_getDatafieldOptions ( int $f_id )
Identifies the value range of a data field (array with label and value).
arrayapi_getDatafields ( int $group )
Delivers a list of all data fields existing in the tenant.

Functions

api_datafieldChangeList

boolean api_datafieldChangeList( int $f_id , array $names , array $values )

Modifies the specified list data field with the transferred values. It is possible to amend the data field with further parameters, as well as remove the existing data field or create a new structure of the list-based data field. The function returns a result immediately, as the data field is created in a background process.

Note: Existing content of this data field can be damaged or deleted by retrieval, in particular when decreasing the value range.

Parameters

int$f_idDatafield ID
array$namesList of labels for the list to create
array$valuesList of values for the list to create

Return Value

booleanSuccess or error code

api_datafieldCreateList

integer api_datafieldCreateList( string $type , string $label , string $location , array $set_labels , array $set_values , bool $hide = false , int $group_id , bool $asynchronous = true , string $description = '' )

Creates a new data field of the type 'select' or 'multiselect'. For 'select' type must be 'enum' and for 'multiselect' type must be 'set'. Two arrays with the value range and labels of the individual values must be transferred. The function immediately returns a result, as the data field is created in a background process. More details on the parameters $group and $asynchronous can be found in the description of api_datafieldCreateSingle().

Parameters

string$typeType of datafield to create. For selects $type is "enum" and for multiselects $tpye is "set"
string$labelLabel of datafield create
string$locationLocation to save datafield (client or dataset table)
array$set_labelsList of labels for the list to create
array$set_valuesList of values for the list to create
bool$hide = falseDatafield in frontend forms [optional]
int$group_idID of group [optional] (only needed when location == 'group')
bool$asynchronous = trueWether to run the creation asynchronously (default true)
string$description = ''Description of datafield usage [optional]

Return Value

integerField ID

api_datafieldCreateSingle

integer api_datafieldCreateSingle( string $type , string $label , string $location = 'dataset' , bool $hide = false , int $length = 255 , int $group_id , bool $asynchronous = true , string $description = '' )

Creates a new data field of the type 'text', 'textfield', 'int', 'date', 'checkbox'. Fields of the type 'text' require a length specification (max. 255 characters). This function immediately returns a result, as the data field is created in a background process.

If $group is included, this data field is created as a group data field for this group. If $asynchronous is set to true, the data field will be created in the background. In this case, the server answers faster, however, the creation of the data field is asynchronous. If false is set, the server will wait with its answer until the data field is created.

Note: Data fields should not be created asynchronously, if they are created within a loop during the import, as the subsequent creation of content for this data field may cause errors.

Parameters

string$typeType of datafield to create
string$labelLabel of datafield create (max. 62 symbols)
string$location = 'dataset'Location to save datafield (client or dataset table)
bool$hide = falseDatafield in frontend forms [optional]
int$length = 255Length of textfield [optional]
int$group_idID of group [optional] (only needed when location == 'group')
bool$asynchronous = trueWether to run the creation asynchronously (default true)
string$description = ''Description of datafield usage [optional]

Return Value

integerDatafield ID


api_datafieldDelete

boolean api_datafieldDelete( int $f_id )

Deletes the given data field.

Parameters

int$f_idDatafield ID

Return Value

booleanSuccess or error code


api_getDatafieldOptions

array|integer api_getDatafieldOptions( int $f_id )

Identifies the value range of a data field (array with label and value).

Parameters

int$f_idDatafield ID

Return Value

array|integerArray with labels and values or error code


api_getDatafields

array api_getDatafields( int $group )

Delivers a list of all data fields existing in the tenant. The following information is transmitted: ID, name, type, hidden, length, location, system field. If a $group is included, only group data fields of this group will be transferred.

Parameters

int$groupGroup ID

Return Value

arrayArray of datafields