Working with External Data Connection of type WebQuery with Node.js via C++

Working with External Data Connection of type WebQuery

The following code shows how to work with an external data connection of type WebQuery. It uses the sample Excel file that you can download from the provided link. You can also see the console output of this code below.

const path = require("path");
const AsposeCells = require("aspose.cells.node");

// The path to the documents directory
const dataDir = path.join(__dirname, "data");
const filePath = path.join(dataDir, "WebQuerySample.xlsx");
// Loads the workbook which contains hidden external links
const workbook = new AsposeCells.Workbook(filePath);

const connections = workbook.getDataConnections();
if (connections.getCount() > 0) {
    const connection = connections.get(0);

    if (connection instanceof AsposeCells.WebQueryConnection) {
        const webQuery = connection;
        console.log("Web Query URL: " + webQuery.getUrl());
    }
}

Console Output

Here is the console output of the above code using this sample Excel file.

Web Query URL: https://docs.aspose.com/cells/nodejs-cpp/