Lewati ke konten utama

Excel Lembar Kerja Terpisah di Power Automate

Apa yang dilakukan oleh tindakan ini?

PDF4me Excel - Lembar Kerja Terpisah membagi buku kerja XLSX multi-lembar menjadi buku kerja lembar tunggal individual di dalam sebuah Power Automate alur. Petakan file sumber dari SharePoint, OneDriveDropbox, Dataverse, atau Outlook lampiran, dan tindakan tersebut mengembalikan sebuah dokumen keluaran array dengan satu file per lembar (dinamai sesuai nama lembar itu sendiri). Bungkus satu Terapkan pada setiap Di sekelilingnya, tulisan akan menyebar ke tujuan mana pun yang Anda pilih. Aksi ini dinamis: tidak masalah apakah buku kerja tersebut memiliki 2 lembar atau 200 lembar.

Postingan Blog Terkait(1)

Memverifikasi Identitas Anda API Meminta

Yang PDF4me Hubungkan konektor di Power Automate memerlukan validitas koneksi memegangmu PDF4me API kunci. Buat koneksi sekali pada saat perancangan alur, lalu setiap PDF4me Tindakan di penyewa Anda menggunakannya kembali.

Fakta Penting yang Tidak Boleh Anda Lewatkan

Satu buku latihan masuk, serangkaian buku latihan keluar.
Outputnya berada di atas dokumen keluaran array. Setiap elemen memiliki miliknya sendiri Nama File Dan Isi FileSelalu ulangi hasilnya dengan Terapkan pada setiapJangan mencoba merujuk langsung ke satu file karena jumlahnya bersifat dinamis.
Nama lembar kerja menjadi nama berkas.
Setiap file keluaran diberi nama sesuai dengan lembar sumbernya dengan .xlsx Ekstensi. Lembar 5 menjadi Sheet5.xlsxNama kustom seperti Kuartal 1 tahun 2025 menjadi Q1 2025.xlsxGunakan itu langsung di Buat file atau ubah terlebih dahulu dengan langkah Compose.
Rumus lintas lembar memang sengaja dibuat tidak valid.
Fungsi Splitting memisahkan lembar kerja menjadi buku kerja independen, sehingga setiap =Lembar2!A1 Referensi dari Sheet1 kehilangan targetnya. Rumus intra-lembar (semua yang berada di lembar yang sama) tetap dipertahankan. Rencanakan terlebih dahulu jika buku kerja Anda menghubungkan nilai di beberapa lembar.
Tindakan Excel - Pisahkan Lembar Kerja di Power Automate. Konten File dipetakan dari langkah Dapatkan konten file Dropbox sebelumnya. Nama File adalah Separate.xlsx. Parameter lanjutan menunjukkan Pengaturan Budaya & Bahasa diatur ke en-US.

Konfigurasi tindakan. Konten file dipetakan dari langkah Dapatkan konten file Dropbox, Nama File Terpisah.xlsx, Pengaturan Budaya & Bahasa en-US.

Parameter

Diperlukan: Isi File. Direkomendasikan: Nama Berkas. Canggih: Pengaturan Budaya & Bahasa (defaultnya adalah bahasa Inggris AS).

ParameterDiperlukanApa fungsinya?Contoh
File ContentYesMulti-sheet XLSX workbook as binary dynamic content from a prior step (SharePoint Get file content, OneDrive Get file content, Dataverse Download file, Dropbox Get file content using path, Outlook Get attachments).@triggerOutputs()?['body']
File NameNoSource filename including .xlsx extension. Defaults to Separate.xlsx. Used for tracking and error messages.Separate.xlsx
Culture & Language SettingsNoStandard culture name controlling how locale-sensitive cell values are interpreted during the split. Defaults to en-US. Use fr-FR, de-DE, ja-JP, etc. when your sheet content uses non-US formats.en-US

Keluaran

Aksi tersebut mengembalikan array file ditambah kolom kesalahan. Power Automate Pemilih konten dinamis menampilkan nama-nama ini:

Pemilih konten dinamis untuk Excel - Lembar Kerja Terpisah: Nama File, Konten File, Pesan Kesalahan, Detail Kesalahan.

Pemilih konten dinamis menampilkan Nama File dan Isi File untuk setiap item dalam outputDocuments, ditambah Pesan Kesalahan / Detail Kesalahan untuk kegagalan.

Bidang konten dinamisJenisIsi di dalamnya
outputDocumentsArrayOne entry per source sheet. Loop with Apply to each.
File Name (item)StringSheet name plus .xlsx extension. Pass directly into Create file File Name.
File Content (item)BinaryThe single-sheet workbook. Pass directly into Create file File Content.
Error MessageStringShort error description on failure. Empty when the action succeeds.
Error Details ItemArrayItemised error messages when multiple issues were encountered. Empty when the action succeeds.

Bentuk respons mentah

Sebagai referensi (atau saat memanggil yang mendasarinya) REST (langsung ke titik akhir), pemisahan 5 lembar akan menghasilkan isi seperti ini:

Respons HTTP mentah dari Excel - Lembar Kerja Terpisah. Kode status 200, Content-Type application/json. Isi respons berisi array outputDocuments dengan 5 entri (Sheet1.xlsx hingga Sheet5.xlsx), masing-masing membawa string Base64 streamFile.

Kode status 200, Tipe Konten aplikasi/json. dokumen keluaran membawa satu {fileName, streamFile} objek per lembar.

File contoh

Contoh alur

Pola alur Common Power AutomateTypical ways to chain Excel - Separate Worksheets into a flow.
Unggahan SharePoint ke pustaka per lembar.
  1. SharePoint Saat sebuah file dibuat Pemicu diaktifkan pada /Documents/InboundWorkbooks.
  2. SharePoint Mendapatkan isi file memuat biner XLSX.
  3. Excel - Opsi "Lembar Kerja Terpisah" memisahkan setiap lembar kerja menjadi satu file.
  4. Terapkan ke setiap outputDocuments → SharePoint Buat berkas di /Documents/ByDepartment menggunakan item Nama Berkas dan Isi Berkas.
Kirim buku kerja melalui email, dapatkan kembali lembar kerjanya.
  1. Outlook Saat email baru tiba Memicu pada kotak masuk perutean dengan lampiran .xlsx.
  2. Terapkan pada setiap lampiran → Excel - Lembar Kerja Terpisah membagi buku kerja.
  3. Terapkan secara internal ke setiap outputDocuments → Outlook Kirim email dengan setiap lembar sebagai lampiran terpisah.
Ekspor massal Dataverse ke OneDrive
  1. Pemicu pengulangan aktif setiap hari Senin pukul 06:00.
  2. Dataverse menghasilkan laporan gabungan sebagai satu buku kerja tunggal.
  3. Excel - Lembar Kerja Terpisah membaginya berdasarkan wilayah atau departemen.
  4. Terapkan pada masing-masing → OneDrive Buat file di bawah /Reports/Weekly/[YYYY-MM-DD]/.

Pertanyaan yang Sering Diajukan

What does Excel - Separate Worksheets return?+
An array called outputDocuments. Each item is an object with File Name (the sheet name plus .xlsx extension) and File Content (the binary single-sheet workbook). A 5-sheet input becomes a 5-element array with Sheet1.xlsx through Sheet5.xlsx.
Do I need to know the sheet count in advance?+
No. The action splits whatever sheets are present in the input workbook. Wrap the result in Apply to each over outputDocuments and the flow handles 2 sheets or 200 sheets without any code change.
Are sheet names preserved as file names?+
Yes. Each output file is named after the source sheet plus the .xlsx extension. Sheet5 becomes Sheet5.xlsx. Custom names like Q1 2025, Sales, Inventory become Q1 2025.xlsx, Sales.xlsx, Inventory.xlsx accordingly.
Does the split preserve formatting, formulas, and named ranges?+
Yes for content on the sheet being split. Each output file is a valid .xlsx with the original cell values, number formats, styles, and intra-sheet formulas. Cross-sheet references (=Sheet2!A1 from Sheet1) cannot survive the split because the referenced sheet is no longer in the same workbook.
Does it work with .xls (legacy Excel 97-2003)?+
The action targets .xlsx (OOXML). Convert .xls files to .xlsx upstream if needed. Saving the file from Excel into the new format is the simplest path.
How do I rename the output files (e.g. add a date prefix)?+
Inside the Apply to each, build the new name with a Compose or expression step before Create file: concat(formatDateTime(utcNow(),'yyyy-MM-dd'),'_',item()?['fileName']) gives you 2026-06-02_Sheet1.xlsx style names.
What does Culture & Language Settings change?+
It tells the engine how to interpret locale-sensitive cell content (decimal separator, date order) during the split. The default en-US is correct for US-style 1,234.56 and MM/dd/yyyy. Switch to fr-FR, de-DE, etc. when your sheets follow other conventions.
Does this work in Power Automate Desktop?+
PDF4me Connect is a cloud connector available in Power Automate (the web flow designer). For Power Automate Desktop, call the same Separate Worksheets REST endpoint with the HTTP action.

Tindakan terkait

Dapatkan Bantuan