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 / 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 (0)

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
Michael E. Gernaey Profile Picture

Michael E. Gernaey 462 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 456 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard