Hoppa till huvudinnehåll
Hoppa över innehållsförteckningen

[LASTVALUE] - Hämtar ett tidigare värde från historiken

Den [LASTVALUE] function allows you to retrieve the most recent previous value of an attribute from the history of a user, group, or department. This function pulls the previous value directly from the object's history log, not from its currently registered attributes.

This is useful for creating notifications or reports that show what has changed, such as displaying both an old and new department name after a user is moved.


Syntax

The basic syntax is:

KOD
[LASTVALUE;AttributeName].
  • AttributeName: The name of the attribute as it appears in the object's history, written without brackets.


Användningsfall

Basic Value Retrieval

To get the previous value for an attribute, simply specify the attribute name. For example to get the previous department number for a primary position, simply write;

KOD
[LASTVALUE;Department Number]

This retrieves the last recorded value for Avdelningsnummer from the object's history.

Fallback to Current Value if History is Empty

You can use the [IFEMPTYUSE] function to display the current value of an attribute if no previous value exists in the history.

KOD
[IFEMPTYUSE;[LASTVALUE;Department Number];[DepartmentNumber]]

This expression first attempts to get the LASTVALUE. If that returns empty, it provides the currently registered AvdelningsNummer as a fallback.

Advanced Combination: Find Previous Manager's Name

You can combine LASTVALUE, IFEMPTYUSE, och REFERENS to perform more complex lookups, such as finding the name of a previous manager. To get the previous manager's name, or the current manager's name as a fallback write:

KOD
[REFERENCE;DisplayName;UserId;1;[IFEMPTYUSE;[LASTVALUE;Manager];[manager]]]

JavaScript-fel har upptäckts

Observera att dessa fel kan bero på din webbläsares inställningar.

Om problemet kvarstår, vänligen kontakta vår support.