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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Office Script (TypeScr...
Power Apps
Unanswered

Office Script (TypeScript) code to advance one cell every time the code runs from Power Automate Excel Run Script

(0) ShareShare
ReportReport
Posted on by 179
Hello, Coding Geniuses

I am pulling images from power automate into excel using the following Run script code:

 

function main(workbook: ExcelScript.Workbook, sheetName: string, address: string, base64ImageString: string) {
 let sheet = workbook.getWorksheet(sheetName);
 let range = sheet.getRange(address);
 let OldDevSNimg = sheet.addImage(base64ImageString);

 for (let i = 0; i < 3; i++) {

 let nextcell = range.getOffsetRange(+1, 0);

 OldDevSNimg.setTop(nextcell.getTop());
 OldDevSNimg.setLeft(nextcell.getLeft());
 OldDevSNimg.setWidth(300);
 OldDevSNimg.setHeight(400);
 OldDevSNimg.setLockAspectRatio(true);
 OldDevSNimg.setPlacement;
 OldDevSNimg.incrementTop(3);
 OldDevSNimg.incrementLeft(5);

 }
}

 

The Power Automate flow is sending a column with multiple images from a SharePoint list which need to be put on their respective rows... The issue I'm having is each image comes across and is placed on top of one another.

I am struggling with a for loop or some way to dynamically change to the next row (in the same column) for each image coming across from power automate.

Or, is there a way to put a function in the 'Address' area of the Run Script action which will automatically move to the next excel row for every item in the 'Apply to each' action?

Flow Run Script.PNG

Any help would be greatly appreciated! Apologies as I am new to Type Script / Power Automate and just can't get the right syntax or expression.

 

Thanks in advance!

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 Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard