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 / Office script - get ce...
Power Automate
Unanswered

Office script - get cell address by value

(0) ShareShare
ReportReport
Posted on by 110
I'm new to Office Scripts and I'm working on integrating Power Automate, SharePoint, and Excel using Office Scripts. I'm hoping you can lend me some guidance.
 
My goal is this: when a user changes the status of a SharePoint list item to "Completed," a Power Automate flow will trigger, passing the item ID to an Office Script.  The Office Script should then search for that item ID within a specific Excel table and return the cell address (e.g., "A4" for ID 71) where the ID is located.
 
 
 
1. I've tried the find() function but it can only search for string. Is there any function can find number (integer)?
function main(workbook: ExcelScript.Workbook) {
    let ws1 = workbook.getActiveWorksheet();
    let range1 = ws1.getUsedRange();

    range1.find(80, {
        completeMatch: true, 
        matchCase: false,
    })
}
 
2. I also gave a thought of getting index from table array and turn it into address. But not sure how to write the script?
 
function main(workbook: ExcelScript.Workbook) {
    let ws1 = workbook.getActiveWorksheet();
    let table1 = ws1.getTable("Completed");

    const table1address = table1.getRangeBetweenHeaderAndTotal().getColumn(0).getValues();

    console.log(table1address.flat())

    console.log(table1address.findIndex(e => e[1] == 70))
}
 
Thank you very much for your help!
Categories:
I have the same question (2)

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!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 959

#2
Valantis Profile Picture

Valantis 872

#3
Haque Profile Picture

Haque 589

Last 30 days Overall leaderboard