web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Get multiple excel cel...
Power Automate
Unanswered

Get multiple excel cell values in a range with Office Script, and return to Power Automate

(0) ShareShare
ReportReport
Posted on by 42

Hi I'm trying to get excel cell values in cells range A1:A7.

 

I can get a single cell value with:

 

function main(workbook: ExcelScript.Workbook) {
    let sheet = workbook.getWorksheet("Sheet1");
    let range = sheet.getRange("A1");
    let returnData = range.getValue();
    return returnData;
};
 
I have tried replacing the A1 value with A1:A7, but this doesn't return the values to Power Automate.
Any help appreciated!
Mike
Categories:
I have the same question (0)
  • Verified answer
    CFernandes Profile Picture
    8,402 Most Valuable Professional on at
    Re: Get multiple excel cell values in a range with Office Script, and return to Power Automate

    Hey @miketurnertech 

     

    Try the script below:  I changed the getRange and also getValue to getValues

     

    function main(workbook: ExcelScript.Workbook) {
        let sheet = workbook.getWorksheet("100 Sales Records");
        let range = sheet.getRange("A1:A7");
        let returnData = range.getValues(); // Corrected method name from getValue() to getValues()
        console.log(returnData);
        return returnData;
    };

     

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

     

    P.S. take a look at my blog here and like & subscribe to my YouTube Channel thanks.

  • JW-17101720-0 Profile Picture
    42 on at
    Re: Get multiple excel cell values in a range with Office Script, and return to Power Automate

    @CFernandes Thank you this has worked 🙂

  • CFernandes Profile Picture
    8,402 Most Valuable Professional on at
    Re: Get multiple excel cell values in a range with Office Script, and return to Power Automate

    @miketurnertech - I am happy that the solution worked. 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Tomac Profile Picture

Tomac 497 Moderator

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 477 Super User 2025 Season 2

#3
chiaraalina Profile Picture

chiaraalina 242

Last 30 days Overall leaderboard