TreeINFO-For-M365 documentation
    Preparing search index...

    This is the script API for managing lists. Use common namespace tisa for all script APIs.

    • Common features of all script APIs are available in the common script API.
    • See the List class for managing the list and its items, selection, and other properties.
    • See the Selection class for accessing the list's selected items.
    • See the Events page for how to handle events.
    const { list } = tisa;
    console.log(list.items);
    const { list } = tisa;

    // access selected items
    console.log(list.selection.selectedItems);

    // some operations
    list.selection.select([1, 2, 3]);
    list.selection.deselectAll();
    interface ListScriptApi {
        context?: BaseComponentContext;
        helpers: ScriptApiHelpers;
        list: List;
        log: Log;
        page: Page;
        sp: SPFI;
        user: User;
        utils: ScriptApiUtils;
        workflow: Workflow;
    }

    Hierarchy (View Summary)

    Index

    Properties

    context?: BaseComponentContext

    SPFx component context. Provides access to the SharePoint page context, current user, site, web, and other SPFx runtime information.

    Helpers service is used to provide various helper functions. You can use this service to get the value of an expression using the expression evaluator. Expression evaluator is a service that is used to evaluate expressions in the script, e.g. {WebUrl} will be evaluated to the web url of the current site.

    list: List
    log: Log

    Log service is used to log messages to the console and application insights. You can use different types of logs, like error, warning, info, debug, trace. And also show a toast message with the logged message. For more details, see Log.

    page: Page

    Provides quick access to SharePoint page context values (current web, site, and list). Shorthand alternative to tisa.context.pageContext.web.* / tisa.context.pageContext.list.*. For more details, see Page.

    sp: SPFI

    SPFI is the PnPjs SharePoint Fluent Interface. Use it to interact with SharePoint REST APIs.

    const { getExpressionValue } = tisa.helpers;
    const items = await tisa.sp.web.getList(getExpressionValue("{SiteUrl}/Lists/MyList")).items();
    console.log(items);
    user: User

    User service is used to get information about the current user. For more details, see User.

    Utils service is used to provide various utility functions. You can use this service to translate text, add a toast message, add a dialog message, run a function with a loader overlay, and make an HTTP request.

    workflow: Workflow

    Workflow service is used to interact with the workflow and provide methods for workflow configuration objects. For more details, see Workflow.