Nevron Vision for SharePoint Documentation
Pivot Engine / Variables / Parameters
In This Topic
    Parameters
    In This Topic

    The parameters collection is automatically populated with custom parameters from the current user session and a set of extended (predefined) parameters, that are always available.

    A custom user session parameter (simply called custom parameter) can be created/assigned in several ways:

    Take a look at the Custom Parameters in SharePoint Pages for an overview of the custom parameters.

    It is important to remember that custom parameters are browser session based. This means that two users, which browse the same SharePoint pages may receive different results, because of the current browser session parameters that they have.
     Using Parameters in Expressions

    Because each parameter is a {name:value} pair, parameters of certain type are consumed by the pivot with the help of an additional value descriptor that is appended to the parameter name. For example: if you have created a parameter named MyParameter of type string you can get the value of this parameter in any expression like this:

    =Params!MyParameter.STR

    Currently supported are string, boolean, numeric and string array parameter types and hence the valid value descriptors for parameter values are STR, BOOL, NUM and STRARR.

    The type suffix can be omitted in the case of which the pivot will return the first parameter with the specified name that matches. The type of variant returned in this case will depend on the parameter initialization type.

    The type in each parameter reference plays an important role when the parameter is not defined. If the pivot is not able to find a parameter with the specified name and type the default value that it will return will depend on the parameter type as follows:

    • STR - default value is an empty string.
    • BOOL - default value is false.
    • NUM - default value is 0.
    • STRARR - default value is an empty array.
    • not specified - default value is an EMPTY variant.
     Predefined Parameters

    Unlike custom parameters, the predefined parameters are always available in all web parts and you do not have to do anything to create them. The purpose of the predefined parameters is to expose some general information about the current SharePoint environment to all expressions.

    The following table summarizes the available predefined parameters:

    Name Description Type

    SharePoint Specific

    [WebPartId] Returns the Id of the web part that renders the pivot. STR
    [PageUrl] Returns the URL of the page on which the web part resides. STR
    [WebUrl] Returns the URL of the web to which the web part belongs. STR
    [SiteUrl] Returns the URL of the site to which the web part belongs. STR
    [UserName] Returns the current user name. STR
    [UserLoginName] Returns the current user login name. STR
    [UserSId] Returns the unique security ID for the network account of the current user. STR

    Browser Specific

    [BrowserName] Returns the browser string (if any) that was sent by the browser in the User-Agent request header. STR
    [BrowserMajorVersion] Returns the major version number of the browser. NUM
    [BrowserMinorVersion] Returns the minor version number of the browser. NUM
    [BrowserScreenWidth] Returns the approximate width of the display, in pixels. NUM
    [BrowserScreenHeight] Returns the approximate height of the display, in pixels. NUM

    See Also