Initializing help system before first use

# Displaying Attachment Data with AutoText

Information about attachments present on the app or scenario can be displayed in a custom view by using the AutoText component.

This is achieved by adding the `data-text` attribute to an HTML element.

The tag name of the attachment must be specified, along with the name of the field that you wish to display:

- filename: The filename of the attachment.
- description: The description of the attachment.
- tags: A comma-separated list of all tags present on the attachment.
- lastModifiedDate: The date when the attachment file contents were last modified.
- lastModifiedUser: The name of the user who last modified the attachment file contents.
- hidden: Whether or not the attachment is hidden in the UI (either "True" or "False").

The examples below demonstrate how to use the `data-text` attribute:

    The filename of the app attachment tagged with input-sheet is:
    <span data-text="attachment:app/input-sheet/filename"></span>

    The description of the scenario attachment tagged with result-chart is:
    <span data-text="attachment:scenario/result-chart/description"></span>

    <!-- For scenario attachments, the "scenario/" prefix is optional: -->
    The scenario attachment tagged with input-sheet was last modified by:
    <span data-text="attachment:input-sheet/lastModifiedBy"></span>

A `ScenarioObserver` must then be created, and `bindAutoText` called, passing a CSS selector which matches the HTML elements to be populated:

    var view = insight.getView();
    view.withFirstScenario()
        .bindAutoText('span[data-text]')
        .start();

If no attachment exists with the specified tag, the HTML element will be populated with a fallback message, `The attachment is not currently available`. An alternative message can be specified using the `data-fallback` attribute. For example:

    The filename of the app attachment tagged with input-sheet is:
    <span data-text="attachment:app/input-sheet/filename"
          data-fallback="No input sheet has been uploaded">
    </span>

Parent Topic Working with Attachments

© 2001-2026 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.