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 / Blank Row in Excel Cau...
Power Automate
Answered

Blank Row in Excel Causing Headaches

(0) ShareShare
ReportReport
Posted on by 88

Hi All,

I have a flow to import data from a spreadsheet using a script. It all works fine and imports all the records, the problem is that the file has a blank line at the bottom (which is unfortunately out of my control), it looks like this,

blank line.png

The flow expects a number but when it hits this line, it errors out.

 

Can anyone think of a way round this please?

My first thoughts would be to add this to the excel script used at import time,

my flow.png

But am struggling on how to implement this in the excel script.

 

Any help much appreciated, this is a bit of a puzzler.

 

Many thanks.

Categories:
I have the same question (0)
  • MikeWJS Profile Picture
    88 on at

    Just to add to this, I think I need to use Office Script to accomplish this, I have tried but this is my first run in with Java 😞 Im so close but just cant get it...

  • Verified answer
    MikeWJS Profile Picture
    88 on at

    Finally cracked it!

    For others, I used,

     let selectedSheet = workbook.getActiveWorksheet();

      let usedRange = selectedSheet.getUsedRange();

      let lastRowAddress = usedRange.getLastCell().getAddress();

      selectedSheet.getRange(lastRowAddress).getEntireRow().delete(ExcelScript.DeleteShiftDirection.up);

     

    Hope this helps someone else!

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 223

#2
David_MA Profile Picture

David_MA 210 Super User 2026 Season 1

#3
Haque Profile Picture

Haque 175

Last 30 days Overall leaderboard