Lewati ke konten utama

Hapus Baris dari Excel di dalam Power Automate

PDF4me Hapus Baris dari Excel adalah sebuah Power Automate tindakan yang menghapus satu atau lebih rentang baris dari suatu Excel Lembar kerja menggunakan sintaks rentang yang dipisahkan koma. Gunakan untuk memangkas baris header, menghapus catatan yang kedaluwarsa, atau membersihkan data sampel setiap kali alur kerja memberikannya buku kerja dan string rentang, dan mengembalikan lembar kerja yang telah dibersihkan. Excel Berkas siap untuk langkah selanjutnya.

Apa yang dilakukan oleh tindakan ini?

PDF4me Hapus Baris dari Excel mengambil sebuah Excel memproses file ditambah string Rentang Baris dan menghapus persis baris-baris tersebut dari lembar kerja target. Rentang dapat menggabungkan baris tunggal dan rentang yang dipisahkan tanda hubung dalam satu permintaan, dan PDF4me selalu menghapus dari nomor baris tertinggi ke bawah sehingga rentang sebelumnya dalam panggilan yang sama tidak pernah bergeser dari tempatnya.

Postingan Blog Terkait
Belum ada postingan blog untuk fitur ini — akan segera hadir.
Sementara itu, jelajahi blog PDF4me untuk menemukan tutorial dan alur kerja di berbagai platform.
Kunjungi blog ini

Memverifikasi Identitas Anda API Meminta

Untuk mengakses PDF4me Web API melalui Power AutomateSetiap permintaan harus menyertakan validitas API Kunci. Otentikasi memvalidasi identitas Anda dan memungkinkan konektor untuk terhubung. PDF4me'S Excel layanan penghapusan baris dari alur kerja Anda.

Fakta Penting yang Tidak Boleh Anda Lewatkan

Rentang Baris adalah satu string yang dipisahkan oleh koma.
Gabungkan baris tunggal dan rentang yang dipisahkan tanda hubung dalam satu kolom, misalnya 1-5,10,15-20. Tanda kurung opsional seperti [1-5] diterima sama seperti 1-5.
Penghapusan selalu berjalan dari bawah ke atas.
PDF4me secara otomatis menghapus nomor baris tertinggi terlebih dahulu, sehingga rentang lain dalam permintaan yang sama tidak pernah bergeser dari posisinya akibat penghapusan sebelumnya.
Nama Lembar Kerja bersifat opsional.
Biarkan kosong untuk menargetkan lembar kerja pertama dalam buku kerja, atau masukkan nama yang tepat dan peka terhadap huruf besar/kecil untuk menargetkan lembar kerja tertentu.
Tindakan Hapus Baris Power Automate PDF4me Excel yang menampilkan kolom Isi File, Nama File, Nama Lembar Kerja, dan Rentang Baris.

Petakan Konten File dan Nama File dari tindakan sebelumnya, atur Nama Lembar Kerja jika target bukan lembar pertama, lalu masukkan Rentang Baris.

Parameter

Diperlukan: Isi berkas, nama berkas, dan rentang baris harus selalu disediakan. Nama lembar kerja bersifat opsional dan secara default menggunakan lembar kerja pertama.

ParameterDiperlukanApa fungsinya?Contoh
File ContentRequiredBase64 or buffer content of the source Excel file, typically mapped from a prior action like SharePoint Get File Content or OneDrive.[File Content from Get File]
File NameRequiredName of the Excel file including its extension, used for processing and naming the output.data.xlsx
Worksheet NameOptionalExact, case-sensitive name of the worksheet to delete rows from. Blank defaults to the first worksheet (index 0).Sheet1
Row RangesRequiredComma-separated row ranges in 1-based format. A single number deletes one row, a hyphenated pair deletes a span, and multiple entries can be combined, for example 1-5,10,15-20.1-5,10,15-20

Apa yang Dikembalikan oleh Penghapusan Baris?

BidangJenisIsi di dalamnya
documentBase64The Excel document with the specified rows removed.
SuccessBooleantrue when the deletion completed, false if the request failed validation or processing.
Error MessageStringDescription of what went wrong, null when Success is true.
ErrorsArrayDetailed error entries with Code and Message, empty when Success is true.

Pesan Kesalahan Umum

Pesan KesalahanMenyebabkanLarutan
Request is emptyRequest object is null.Provide a valid request object.
Document is emptyDocument object is null.Provide a valid Excel document.
Row ranges are requiredRowRanges is null or an empty string.Provide a valid row range specification.
Invalid worksheet selectionWorksheetName doesn't exist in the workbook.Use an existing worksheet name.
Invalid start row {row}. Row numbers must be positive.Row number is less than 1, such as "0-5" or "-1".Use row numbers of 1 or greater (1-based indexing).
Row {row} exceeds maximum data row ({maxRow})Row number is greater than the worksheet's data row count.Use row numbers within the valid range, 1 to maxRow.
Invalid range {start}-{end}: End row cannot be less than start rowEnd row is smaller than start row, such as "10-5".Make sure the end row is greater than or equal to the start row.
Invalid row range formatMalformed range string that couldn't be parsed.Check the syntax, use commas and hyphens correctly.

Bagaimana Cara Mengatur Penghapusan Baris di Power Automate?

  1. Menambahkan PDF4meHapus Baris dari Excel untuk Anda Power Automate mengalir.
  2. Peta Isi File Dan Nama File dari tindakan sebelumnya, seperti SharePoint atau OneDrive Dapatkan Isi File.
  3. Mengatur Nama Lembar Kerja Jika targetnya bukan lembar kerja pertama, biarkan kosong.
  4. Memasuki Rentang Baris sebagai string yang dipisahkan koma, misalnya 1-5,10,15-20.
  5. Jalankan alur kerja. Baris akan dihapus secara otomatis dari bawah ke atas, dan file yang telah dibersihkan akan dikembalikan sebagai berikut. document.

Pengaturan Umum

Contoh Alur KerjaCommon Power Automate flow patterns using Delete Rows from Excel.
Pembersihan header dan footer laporan
  1. Pemicu alur kerja akan aktif ketika laporan internal ditandai siap untuk klien.
  2. Get File Content mengambil laporan dari SharePoint.
  3. Hapus Baris dari Excel dijalankan dengan Rentang Baris yang diatur ke baris header dan footer internal, misalnya "1-3,96-100".
  4. Berkas yang telah dibersihkan dikirim melalui email kepada klien dan berkas aslinya diarsipkan secara terpisah.
Pemangkasan log transaksi terjadwal
  1. Pemicu pengulangan menjalankan alur pengarsipan bulanan.
  2. Get File Content mengambil Excel log transaksi dari SharePoint.
  3. Langkah sebelumnya mengidentifikasi baris yang lebih lama dari jendela retensi dan membangun string Rentang Baris secara dinamis.
  4. Hapus Baris dari Excel Menghapus baris-baris tersebut, dan log yang telah dipangkas disimpan kembali ke SharePoint.
Penghapusan data sampel templat
  1. Proses orientasi karyawan baru dimulai di sistem SDM.
  2. Get File Content mengambil templat laporan pengeluaran dari pustaka templat.
  3. Hapus Baris dari Excel Menghapus baris sampel dengan Rentang Baris yang diatur ke "2-10" dan Nama Lembar Kerja yang diatur ke "Pengeluaran".
  4. Templat yang bersih dikirimkan melalui email kepada karyawan baru dengan header baris 1 tetap utuh.

Tips Praktis

Count rows before building the range string
Row Ranges rejects any row number past the worksheet's data row count, so confirm the row count first if you are constructing ranges dynamically from another action's output.
Combine ranges in one call instead of looping
A single Row Ranges string like "1-5,10,15-20" deletes multiple spans in one action run, which is simpler to maintain than chaining several Delete Rows actions.
Match Worksheet Name exactly, including case
Worksheet Name comparison is case-sensitive. A mismatch returns an invalid worksheet selection error even if the name looks correct at a glance.
Brackets around a range are optional
Both "1-5" and "[1-5]" are accepted for the same range, so either format works if the string is being generated by another system.
Don't worry about deletion order in the input
You can list ranges in any order in Row Ranges. PDF4me sorts and deletes from the highest row number down automatically to avoid index shifting.

Lembar Panduan Singkat

BidangNilai
ActionDelete Rows from Excel
File ContentMapped from a prior file-retrieval action
File Namee.g. data.xlsx
Worksheet NameBlank = first worksheet, or exact case-sensitive name
Row Ranges format1-based, comma-separated: "1-5,10,15-20"
Deletion orderBottom-to-top automatically, no action needed
Outputdocument (Base64), Success, Error Message, Errors

Pertanyaan Umum

How do I delete rows in Excel using Power Automate?+
Add the PDF4me Delete Rows from Excel action, map File Content and File Name from a prior action, set Worksheet Name if needed, and provide Row Ranges as a comma-separated string such as 1-5,10,15-20. Running the flow returns the Excel file with those rows removed.
What format does Row Ranges use?+
Row Ranges is a comma-separated string using 1-based row numbers. Use a single number for one row, a hyphenated pair for a range, and commas to combine several, for example 1-5,10,15-20 deletes rows 1 through 5, row 10, and rows 15 through 20.
Why are rows deleted bottom-to-top instead of top-to-bottom?+
Deleting from the bottom up prevents index shifting. If rows were removed top-to-bottom, every deletion would shift the remaining row numbers up by one, causing later ranges in the same request to target the wrong rows. See <a href="https://learn.microsoft.com/en-us/office/vba/api/excel.range.delete" target="_blank" rel="noopener noreferrer">Microsoft's Excel Range.Delete reference</a> for how row shifting works natively in Excel.
What happens if a row range is invalid?+
The action returns Success as false with an ErrorMessage describing the problem, for example a row number that exceeds the worksheet data row count, or a range where the end row is smaller than the start row. No rows are deleted when the request fails validation.
Can I delete rows from a worksheet other than the first one?+
Yes. Set Worksheet Name to the exact, case-sensitive name of the target worksheet. Leaving it blank defaults to the first worksheet in the workbook. See <a href="https://learn.microsoft.com/en-us/connectors/pdf4meconnect/" target="_blank" rel="noopener noreferrer">the PDF4me Power Automate connector reference</a> for the full action list.

Studi Kasus & Aplikasi Industri

Studi Kasus Keuangan & Akuntansi

  • Pembersihan TransaksiHapus baris transaksi lama atau yang tidak berlaku dari log akuntansi.
  • Penutupan Periode: Hapus baris perhitungan sementara setelah penutupan akhir bulan
  • Distribusi LaporanHapus catatan internal dan komentar ulasan dari laporan klien.
  • Templat AnggaranHapus data sampel tahun sebelumnya dari templat anggaran baru.

Tindakan Terkait

Tugas yang Sama di Platform Lain

Dapatkan Bantuan