Tableau Extensions API
    Preparing search index...

    Interface Environment

    The environment namespace provides a way to programmatically gather information about the environment in which the Extensions is running.

    interface Environment {
        apiVersion: string;
        context: ExtensionContext;
        country?: string;
        exportedMediaType?: ExportedMediaType;
        isExporting: boolean;
        language: string;
        locale: string;
        mode: ExtensionMode;
        operatingSystem: string;
        tableauVersion: string;
        uniqueUserId?: string;
        workbookFormatting?: WorkbookFormatting;
        workbookLocale: string;
    }
    Index

    Properties

    apiVersion: string

    The version of the API being used by the Extensions.

    Current context in which the Extensions is running (i.e. Desktop or Server).

    country?: string

    The country of the Tableau instance that is running the Extension. The country is the ISO 3166 country string represented by the user specified language. If the user specified lanugage is Français (Canada), country is CA.

    1.9.0 and Tableau 2022.2 If running against a Tableau version prior to 2022.2, country will be undefined.

    exportedMediaType?: ExportedMediaType

    The media type of the exported content if the extension is running in exporting mode, undefined otherwise.

    isExporting: boolean

    True if the extension is running in exporting mode, false otherwise.

    language: string

    The language of the Tableau instance that is running the Extension. The language is the ISO 639 language string of the user specified language. If the user specified language is Français (Canada), language is fr.

    locale: string

    The OS locale of the environment in which the Extension is running. Tableau Server supports both a language and a locale. This is the locale as defined in RFC 5646 in lowercase. If the user specified locale is English (United States), the locale is en-us.

    Current mode of the Extensions (i.e. authoring or viewing).

    operatingSystem: string

    The OS in which Tableau is running.

    tableauVersion: string

    The version of Tableau that is running the Extensions.

    uniqueUserId?: string

    A unique id representing the current user. The id is unique across a Tableau deployment or across a Tableau Cloud Site. When the extension is running in desktop, the uniqueUserId is derived from machine-name/user-name. When the extension is running in server, the uniqueUserId is derived from the user's login name. There is no mechanism to obtain the actual user name or any additional user information. If running against a Tableau version prior to 2023.2, uniqueUserId will be undefined.

    workbookFormatting?: WorkbookFormatting

    WorkbookFormatting contains an array of FormattingSheets that will get your formatting information from the workbook. The types of sheet formatting by Class Name Key: WorksheetTitle, Worksheet (body text), Tooltip, StoryTitle, and DashboardTitle These formatting sheets include the following CSS properties: fontName, fontSize, isFontBold, isFontItalic, isFontUnderlined, and color.

    1.7.0 and Tableau 2021.4

    workbookLocale: string

    The locale of the workbook. This is the locale as defined in RFC 5646 in lowercase. If the user specified locale is English (United States), the locale is en-us.

    1.16.0