@GetProfileField (Formula Language)

Retrieves a field from a profile document, and caches the field value for the remainder of the session.

Syntax

@GetProfileField( profilename ; fieldname ; uniqueKey )

Parameters

profilename

Text. The name of the profile document that contains the field you want to access.

fieldname

Text. The name of the field you want to access.

uniqueKey

Text. Optional. The unique key that identifies a profile document.

Return value

fieldvalue

The value of the field.

Usage

This function does not work in column, hide-when, section editor, or view selection formulas. You can use it in toolbar buttons or agents.

You can use this function on the Web. Use @SetProfileField to create a profile document in a Web application. If no profile document by the name specified as the first parameter to @SetProfileField exists, Notes® creates one. This function enables you to access the fields in that profile document.

Use profile documents for values that change infrequently. The profile is cached in local memory for performance, so if one user changes the value in the profile, other users will not see the change immediately. Do not use profile documents to sequentially number documents. Users should be able to see their own changes immediately in Notes® client applications, since they are updating their own cache as well as the stored profile document. However, in Domino® web applications, multiple server processes have their own profile cache, so a change in a profile document might not immediately apply in all parts of the web application.

Examples

  1. This example gets the contents of the "ProfileCategories" field of the "Interest Profile" document.
    @GetProfileField("Interest Profile"; 
    "ProfileCategories") 
  2. This example gets the contents of the "ProfileCategories" field of the "Interest Profile" document for the profile document for Monday if weekday has "Monday" as its default value.
    @GetProfileField("Interest Profile"; 
    "ProfileCategories"; "weekday") 
  3. This example gets two field values from the age and job fields of the "userprofile" profile document and displays them vertically in a view column. The following code is in the "profile" field of a user-accessible form:
    @Explode(@GetProfileField("userprofile"; "age"; @UserName):@GetProfileField("userprofile"; "job"; @UserName); ":")

    The column formula of the view that displays these two values has its view properties set to Lines per row = 2 and Shrink rows to content and column properties set to Multi-value separator = New Line. The column value formula is the following:

    @Trim(profile)

    The @Explode function replaces the semicolon (;) that returns to the profile field with the colon (:) which indicates to the @Trim function in the column formula that the two values are a text list.

  4. The following code, when added to the Update Info action button in a Web form, retrieves the user name and address information from the user's profile document ("Profile") and fills the name and address fields on the Web form with that information:
    tempName := @GetProfileField("Profile";"userName";@UserName);
    tempAddress := @GetProfileField("Profile";"userAddress";@UserName);
    @SetDocField(@DocumentUniqueID;"name";tempName);
    @SetDocField(@DocumentUniqueID;"address";tempAddress);