cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Get cell value from excel using office script

Hi all

 

I want to use office scripts to return the value of C14 to my flow for use. I cannot seem to find anywhere to start with this.

all help will be appreciated.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Anonymous
Not applicable

I have since figured this out. If anyone else wants it, here is the script:

 

function main(workbook: ExcelScript.Workbook😞 string {
  let sheet = workbook.getWorksheet("type name of sheet");
  let range = sheet.getRange("C14");
  return JSON.stringify(range.getValues());
}

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

I have since figured this out. If anyone else wants it, here is the script:

 

function main(workbook: ExcelScript.Workbook😞 string {
  let sheet = workbook.getWorksheet("type name of sheet");
  let range = sheet.getRange("C14");
  return JSON.stringify(range.getValues());
}
moutinhoabreu
Advocate IV
Advocate IV

Thanks.

It worked.

However in my case always returns a null value from log.

Do you know hot to receive just the value?

 

{
  "result": "[[2261.58636363636]]",
  "logs": []
}

 

JemmaKSS
Frequent Visitor

Hi!

have you made sure that the right sheet name replaced the text in the script? Ive had no issues with this 🤔

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (4,694)