Toggle menu

User Profile - Load

This field type is used to load a site user's profile. It will perform this server-side when the form is being rendered.

The profile is loaded by invoking the iCM API worker service. It will attempt to load the profile for the user ID specified by the site template in the SITEUSERID context variable. If this ID is zero, an empty profile will be loaded. If the name of the user set in the SITEUSERNAME context variable is that of your site's "anonymous" user, no profile will be loaded.

On loading a user profile, a server-side persistent form helper variable, matching this field's name, will be created. This will contain a JavaScript object representing the user profile. This may contain nested objects. The default is to load the whole profile, however it is possible to set which fields are returned.

It is also possible to search for user profiles using a search query. This will load all matching user profiles. In this case the form helper variable will contain a JavaScript array of user profile objects.

By default the user profile information is only available server-side. This can be changed but should be used with care, particularly if all profile fields are being loaded since it may expose sensitive user information.

Note that this field is only capable of loading user profiles as a server-side operation, it cannot perform AJAX style requests.

Properties

LabelDescriptionType Name
Query TypeThe type of user profile query to be performed.

Pick "Context" to retrieve the current logged in user's profile. Pick "Search" to retrieve one or more user profiles using a Search Query
QUERYTYPE
Returned FieldsA comma separated list of the fields to return from the user profile(s) into the server-side variable. Leave empty to load all user profile fields. For nested user profiles dot notation should be used.

userID, userName, proxyUserID, proxyUserName, objectID, objectType and groups will always be returned, in addition to the user profile fields specified here
FIELDS
Search QueryTo perform a search, change the Query Type to "Search". Search queries are designed to load the profiles of users other than the current user. 

The properties you'd like to search on need to be set as "Searchable" in your user profile definition.

Enter a string to load any profiles with that value indexed into the search index body field. The search body contains the values of all searchable fields within the profile.

You can also search for values of fields entered on previous pages of the form using the #FIELDNAME# convention. This would, for example, let you enter the email address of a user on page 1, then load their profile on page 2
QUERYPARAM
Browser VariableIf this property is set to true, details of the retrieved user profile(s) will also be stored in a client-side variable. This option should be used with care to ensure that sensitive user information is not exposed.

Use the Browser Returned Fields property to restrict the data that is stored client-side
OUTPUTCLIENT
Browser Return FieldsWhen the Browser Variable property is set, use this property to specify a comma separated list of the fields that should be loaded into the browser (client) variable. Leave empty to load the same fields that are loaded server-side ie those specified via the Returned Fields property.

userID, userName, proxyUserID, proxyUserName, objectID and objectType values will always be returned
CLIENTFIELDS
Anonymous UserName of the iCM site user that represents anonymous users. When the Query Type is set to "Context", if no user is currently logged in to the site then no attempt to load a user profile will be made.

This field determines whether a user is logged by comparing the current site user's name to the one specified here
ANONYMOUS
DocumentationAdd documentation to your field to help explain any complex functionality to future users. You might include information on what the field does and how it relates to other fields on the form. Notes added here are only ever visible in the Forms Designer, they can be searched for, viewed and downloaded from the action panel. See Common Field Properties for an exampleDOCUMENTATION

Example Return

This shows a simple profile being returned, along with top level user properties and the groups the user is a member of.

{
    "PREFNAME": "Tim",
    "MOBILE": "",
    "LASTNAME": "Gulliver-Haynes",
    "CITY": "Plymouth",
    "EMAIL": "support@gossinteractive.com",
    "FIRSTNAME": "Tim",
    "TELEPHONE": "",
    "userID": "186",
    "userName": "TIM",
    "objectID": "19307",
    "objectType": "FORM_USERPROFILE",
    "proxyUserID": "",
    "proxyUserName": "",
    "groups": {
        "STAFF": 4,
        "ICMSITEUSER": 9
    },
    "prefUserName": "Tim",
    "displayUserName": "Gulliver-Haynes, Tim, support@gossinteractive.com, TIMG"

Last modified on 19 April 2024

Share this page

Facebook icon Twitter icon email icon

Print

print icon