Hi,
I'm trying to generate a Word document by pulling information from an Excel file. I'm getting stuck trying to read the information from Excel.
I'm using 'Run script from SharePoint library', which then runs the following office script to return the data that will populate the Word document:
function main(workbook: ExcelScript.Workbook) {
// Set some variables
let ws = workbook.getWorksheet("Review");
// Create objectwith data
let objMeeting = {
"Meeting Date": ws.getRange("rngReviewDate").getValue(),
"Location": ws.getRange("C17").getValue(),
"Attendees": ws.getRange("C18").getValue(),
"Agenda": ws.getShape("tbAgenda").getTextFrame().getTextRange().getText(),
"General Notes": ws.getShape("tbPersonalNotes").getTextFrame().getTextRange().getText(),
"Superannuation Notes": ws.getShape("tbSuperNotes").getTextFrame().getTextRange().getText(),
"Investment Notes": ws.getShape("tbInvNotes").getTextFrame().getTextRange().getText(),
"Debt Notes": ws.getShape("tbDebtNotes").getTextFrame().getTextRange().getText(),
"Insurance Notes": ws.getShape("tbInsNotes").getTextFrame().getTextRange().getText(),
"RPisk Profile Notes": ws.getShape("tbRPNotes").getTextFrame().getTextRange().getText(),
"General Outcomes": ws.getShape("tbPersonalAction").getTextFrame().getTextRange().getText(),
"Superannuation Outcomes": ws.getShape("tbSuperAction").getTextFrame().getTextRange().getText(),
"Investment Outcomes": ws.getShape("tbInvAction").getTextFrame().getTextRange().getText(),
"Debt Outcomes": ws.getShape("tbDebtAction").getTextFrame().getTextRange().getText(),
"Insurance Outcomes": ws.getShape("tbInsAction").getTextFrame().getTextRange().getText(),
"Risk Profile Outcomes": ws.getShape("tbRPAction").getTextFrame().getTextRange().getText(),
}
return objMeeting;
}
If I manually run the Office Script in Excel I can see that the script works and objMeeting stores all the information correctly. However, in Power Automate the body from outputs is:
{
"result": {
"Meeting Date": "",
"Location": "",
"Attendees": "",
"Agenda": "",
"General Notes": "",
"Superannuation Notes": "",
"Investment Notes": "",
"Debt Notes": "",
"Insurance Notes": "",
"RPisk Profile Notes": "",
"General Outcomes": "",
"Superannuation Outcomes": "",
"Investment Outcomes": "",
"Debt Outcomes": "",
"Insurance Outcomes": "",
"Risk Profile Outcomes": ""
},
"logs": []
}
Thanks for any help.