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

    Interface WSDataSourceConfiguration

    interface WSDataSourceConfiguration {
        Cache?: string;
        MethodName: "GET" | "POST";
        RequestType: "REST" | "SOAP";
        ResultSet: ResultSet[];
        ResultSetItems?: string;
        ResultSetType: "JSON" | "XML";
        Url: string;
    }

    Hierarchy (View Summary)

    Index

    Properties

    Cache?: string

    Enables caching of fetched data. The value is a duration string in HH:MM:SS format.

    • With expiration ("HH:MM:SS" where at least one part is non-zero) — data is stored in localStorage with an expiration timestamp. Expired entries are removed automatically on next read.
    • Without expiration (undefined / omitted) — data is stored in sessionStorage and lives until the browser tab is closed.

    In both cases the data is also kept in an in-memory map for the lifetime of the page, so repeated reads within the same page load are instant.

    Cache keys are scoped per site (TiSa-{siteName}-…), so data from different sites never collides.

    Example: "24:0:0" caches for 24 hours in localStorage.

    Note: cache is bypassed entirely when a custom function returns { response: ... } (direct response). Use ?disableCache=true in the URL to disable persistent storage during development.

    "1:0:0" // 1 hour
    
    MethodName: "GET" | "POST"

    The HTTP method to use for the request. Only GET and POST are supported. To use other methods (e.g. PUT, PATCH, DELETE), override via ExternalLookupRequestOverride.method.

    RequestType: "REST" | "SOAP"

    Specifies the request protocol.

    • "REST" — standard HTTP call; method, headers, and body are taken from configuration and optionally overridden by the custom function via ExternalLookupRequestOverride.

    • "SOAP" — the request is sent as an HTTP POST with Content-Type: text/xml; charset=utf-8 and a SOAPAction header. The custom function must return { request: { soapAction, soapEnvelope } } — both fields are required; without them the SOAP call cannot be constructed. Set ResultSetType to "XML" when using SOAP.

    ResultSet: ResultSet[]

    Maps response field paths to expression tokens used in IndexValue, TextValue, DataTableElements, etc.

    JSON — dot-notation path resolved by lodash get on each item object:

    • "ico"item.ico
    • "sidlo.nazevObce"item.sidlo.nazevObce
    • "address.lines[0]"item.address.lines[0]

    XML — dot-delimited element local names resolved relative to each repeating element (the elements matched by ResultSetItems). The resolved value is the element's textContent. Namespace prefixes are ignored:

    • "Id"<Id>42</Id>
    • "Address.City"<Address><City>Prague</City></Address>
    "ResultSet": [
    { "Name": "Nazev", "Path": "obchodniJmeno" },
    { "Name": "ICO", "Path": "ico" },
    { "Name": "Obec", "Path": "sidlo.nazevObce" }
    ]
    "ResultSet": [
    { "Name": "Id", "Path": "Id" },
    { "Name": "Title", "Path": "Title" },
    { "Name": "Country", "Path": "Address.Country" }
    ]
    ResultSetItems?: string

    Specifies path to the array of result items within the response.

    JSON — dot-notation path resolved by lodash get (same syntax as ResultSet[].Path):

    • "value"response.value
    • "result.items"response.result.items

    XML — dot-delimited element local names from the document root element downward. Namespace prefixes are ignored (matching is done by local name only):

    • "Body.SearchResponse.Items.Item"<s:Envelope><s:Body><SearchResponse><Items><Item>…

    If the response root is already the array (JSON) or the document's direct children are the repeating elements (XML), leave this property empty or omit it.

    ResultSetType: "JSON" | "XML"
    Url: string

    The https request URL. It may also include the token {searchText} in case your MethodName is set to GET.