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 / Can we Duplicate an ex...
Power Automate
Answered

Can we Duplicate an excel worksheet inside my flow

(0) ShareShare
ReportReport
Posted on by 2,015 Season of Giving Solutions 2025
I have an excel worksheet which contain 3 tables. the tables contain formulas and conditional formatting for the cells. so i do not want to recreate all the logic inside power automate, instead i want to duplicate this worksheet and add values inside the new worksheet tables..can this be done  inside power automate and how?
 
Regards
I have the same question (0)
  • Verified answer
    Sunil Kumar Pashikanti Profile Picture
    2,318 Moderator on at
     
    Power Automate alone cannot duplicate an Excel worksheet. Use an Office Script to copy the worksheet with all tables, formulas, and formatting, then use Power Automate to insert data into the copied tables.
     
    Recommended and supported way
    Use Office Scripts called from Power Automate to:
    1. Duplicate the worksheet
    2. Keep formulas, tables, and formatting
    3. Return table names
    4. Then update table rows in Power Automate
    This is the correct and scalable approach.
     
    What will NOT work
    • Power Automate cannot clone a worksheet using Excel Online actions
    • Power Automate cannot copy formulas or conditional formatting
    • Excel actions only work with existing tables, not sheet structure
    What you should do
    Use an Office Script to duplicate the worksheet.

    How it works
    1) Create an Office Script that:
    • Copies the template worksheet
    • Renames it
    • Keeps all tables, formulas, and formatting
    • Returns table names

    2) Call the script from Power Automate
    3) Use Excel actions to insert values into the copied tables
     
    Sample Office Script (Minimal and practical)
    function main(workbook: ExcelScript.Workbook) {
      const template = workbook.getWorksheet("Template");
      const newSheet = template.copy(ExcelScript.WorksheetPositionType.end);
      
      const newName = `Run_${Date.now()}`;
      newSheet.setName(newName);
      // Grab the first table on the new sheet and give it a predictable name
      const table = newSheet.getTables()[0];
      const uniqueTableName = "Table_" + newName;
      table.setName(uniqueTableName);
      return {
        sheetName: newName,
        tableName: uniqueTableName // Return a single string instead of an array for easier Flow mapping
      };
    }
     
    Power Automate flow steps
    1. Trigger the flow
    2. Run Office Script (Excel Online Business)
    3. Capture output table names
    4. Loop through table names
    5. Use Add a row into a table or Update a row
    6. Formulas and formatting are preserved automatically

    ✅ If this answer helped resolve your issue, please mark it as Accepted so it can help others with the same problem.
    👍 Feel free to Like the post if you found it useful.

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Valantis Profile Picture

Valantis 377

#2
11manish Profile Picture

11manish 279

#3
David_MA Profile Picture

David_MA 234 Super User 2026 Season 1

Last 30 days Overall leaderboard