Skip to main content

FieldLogs

Get Current Task

Flkw:GetCurrentTask() retrieves the details of the currently running Task as a JSON object. This Instruction is available in the Custom Function scripting context.

This Instruction allows Custom Functions to automatically retrieve the Task context (such as the work order number) without requiring the technician to manually enter it.

Important

If no Task is currently running when this Instruction is called, no data is returned. Ensure a Task is active before calling this Instruction.

This is accomplished by the following FieldLogs specific Instruction:

Flkw:GetCurrentTask();

Flkw:GetCurrentTask() returns a JSON object containing the full details of the Task that is currently being executed.

It does not require any parameters. The returned object contains the following properties.

Format : Flkw:GetCurrentTask();

Return Property

Description

id

The unique identifier of the current Task.

taskName

The name of the current Task.

jobName

The name of the job (work order) associated with the Task.

assignee

The user currently assigned to perform the Task.

assigner

The user who assigned the Task.

status

The current execution status of the Task (e.g., In Progress).

templateId

The identifier of the Template used to create the Task.

properties

A JSON object containing additional custom properties defined for the Task.

Example Return Value

An example of values returned by Flkw:GetCurrentTask() is shown below.

getval.png

Usage Example

In a Tool Calibration Custom Function, you can use Flkw:GetCurrentTask() to automatically retrieve the work order number instead of requiring manual entry.

taskeg.png