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

Announcements

News and Announcements icon
Community site session details

Community site session details

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

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,482 Most Valuable Professional on at

    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

    @CFernandes Thank you this has worked 🙂

  • CFernandes Profile Picture
    8,482 Most Valuable Professional on at

    @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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 124 Super User 2026 Season 1

#2
Ellis Karim Profile Picture

Ellis Karim 52 Super User 2026 Season 1

#3
Haque Profile Picture

Haque 50

Last 30 days Overall leaderboard