Skip to main content

FieldLogs

Get Current User

Flkw:GetCurrentUser() retrieves the identity details of the currently logged-in user as a JSON object. This Instruction is available in the Custom Function scripting context.

This Instruction allows Custom Functions to automatically identify the technician without requiring them to manually enter their user details each time.

This is accomplished by the following FieldLogs specific Instruction:

Flkw:GetCurrentUser();

Flkw:GetCurrentUser() returns a JSON object containing the logged-in user's profile information.

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

Format : Flkw:GetCurrentUser();

Return Property

Description

firstName

The first name of the logged-in user.

lastName

The last name of the logged-in user.

companyId

The company identifier associated with the logged-in user's account.

id

The unique identifier of the logged-in user.

email

The email address of the logged-in user.

Example Return Value

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

CurrentUsereg.png

Usage Example

In a Tool Calibration Custom Function, you can use Flkw:GetCurrentUser() to automatically retrieve the technician's employee ID (companyId) instead of requiring manual entry.

exampleusage.png