Field API Module

class qe_api_client.api_classes.engine_field_api.EngineFieldApi(socket)[source]

Bases: object

A client for interacting with the Qlik Engine JSON API for field operations.

Parameters:

socket – An object representing the engine socket connection used to communicate with the Qlik Engine.

clear(fld_handle)[source]

Clears the selection in a field.

Parameters:

fld_handle (int) – The handle of the field.

Returns:

The response from the engine, containing the result or an error message.

Return type:

dict

get_cardinal(fld_handle)[source]

Gets the number of distinct values in a field.

Parameters:

fld_handle (int) – The handle of the field.

Returns:

The number of distinct values in the field, or an error message.

Return type:

int

select(fld_handle, value, soft_lock=False, excluded_values_mode=0)[source]

Selects field values matching a search string.

Parameters:
  • fld_handle (int) – The handle of the field.

  • value (str) – String to search for. Can contain wild cards or numeric search criteria.

  • soft_lock (bool) – Set to true to ignore locks; in that case, locked fields can be selected.

  • excluded_values_mode (int) – Include excluded values in search.

Returns:

The response from the engine, containing the result or an error message.

Return type:

dict

select_excluded(fld_handle, soft_lock=False)[source]

Inverts the current selections.

Parameters:
  • fld_handle (int) – The handle of the field.

  • soft_lock (bool) – Set to true to ignore locks; in that case, locked fields can be selected.

  • false. (The default value is)

Returns:

true/false. The operation is successful if qReturn is set to true.

Return type:

bool

select_possible(fld_handle, soft_lock=False)[source]

Selects all possible values in a field.

Parameters:
  • fld_handle (int) – The handle of the field.

  • soft_lock (bool) – Set to true to ignore locks; in that case, locked fields can be selected.

  • false. (The default value is)

Returns:

true/false. The operation is successful if qReturn is set to true.

Return type:

bool

select_values(fld_handle, values, toggle_mode=False, soft_lock=False)[source]

Selects multiple values in a field.

Parameters:
  • fld_handle (int) – The handle of the field.

  • values (list) – A list of field values to select. Mandatory field.

  • toggle_mode (bool) – The default value is false.

  • soft_lock (bool) – Set to true to ignore locks; in that case, locked fields can be selected.

  • false. (The default value is)

Returns:

The response from the engine, containing the result or an error message.

Return type:

dict