This is a sample program to read an excel file from Onedrive using Microsoft graph.
var graph = require('@microsoft/microsoft-graph-client');
module.exports = {
getExcelContent: async function (accessToken) {
const client = getAuthenticatedClient(accessToken);
try {
let events;
events = await client.api("/me/drive/items/3E8A3E1FFEFBEAA8!1052/workbook/worksheets('Sheet1')/usedRange")
.get();
return events;
}
catch (err) {
consol.log("getExcelContent Exception: " + err.message);
}
}
};
function getAuthenticatedClient(accessToken) {
// Initialize Graph client
const client = graph.Client.init({
// Use the provided access token to authenticate
// requests
authProvider: (done) => {
done(null, accessToken);
}
});
return client;
}
If the excel file size is than 25 kb, this program works fine and getting the excel content as JSON. But if the excel has more rows this program not proceeding further after this line.
events = await client.api("/me/drive/items/3E8A3E1FFEFBEAA8!1052/workbook/worksheets('Sheet1')/usedRange")
.get();
Not giving any exception also.
Is there any limit on response size or any settings to update?