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 / Insert Row Into a Spec...
Power Automate
Unanswered

Insert Row Into a Specific Row Number of Table

(0) ShareShare
ReportReport
Posted on by 16

How to insert data in a specific row number of table using Power Automate?

Categories:
  • Nived_Nambiar Profile Picture
    18,138 Super User 2026 Season 1 on at

    Hi @MS12341 

    There is no direct action but you can use office script in excel to do that

     

    office script

     

     

    /**
     * This script adds a new row to a table.
     */
    function main(workbook: ExcelScript.Workbook, index: number, values: string[]) {
     // Get the first table in the workbook.
     const table = workbook.getTables()[0];
     // Append a new row to the table with the specified values. 
     table.addRow(index, values);
    }
    
    


    Now in flow use office scipt action to add rows to specific row index

    Nived_Nambiar_0-1680676089090.png

     

     

    here for demo: i have created array using createArray function , note that in this office script pass the string array only 

     

    Hope it helps 

    Mark it as solution if it resolves your query 🙂

     

  • MS12341 Profile Picture
    16 on at

    Hi @Nived_Nambiar ,

     

    I'm not fimilar with office script, can you please tell me how can I write my own script in office script ?

  • Nived_Nambiar Profile Picture
    18,138 Super User 2026 Season 1 on at

    Hi @MS12341 

     

    Open the excel file and click Automate menu as highlighted below

    Nived_Nambiar_0-1680678000674.png

     

    Click New script

    Nived_Nambiar_1-1680678032802.png

     

    Now copy the office script which i shared above message, and paste it there like below

     

    Nived_Nambiar_2-1680678149938.png

     

    The script named here will be Script6 (in my case), you can rename it if you want 🙂

    Then select the same office script name when you are using run office script action 🙂

     

    Hope this helps 🙂

     

  • MS12341 Profile Picture
    16 on at

    @Nived_Nambiar , thanks for this details explanation. But I can't find the Automate section in my Workbook:

    MS12341_0-1680678343434.png

     

  • Nived_Nambiar Profile Picture
    18,138 Super User 2026 Season 1 on at
  • MS12341 Profile Picture
    16 on at

    Hi @Nived_Nambiar ,

     

    Yes, I'm using Excel in Web.

  • Nived_Nambiar Profile Picture
    18,138 Super User 2026 Season 1 on at

    Hi @MS12341 

     

    I think you need to enable office script from admin center

    check this for more details

     

    https://www.thespreadsheetguru.com/blog/enable-office-scripts-excel-online

  • MS12341 Profile Picture
    16 on at

    Hi @Nived_Nambiar 

     

    Do you know the possible reason of this, while trying to use addRow function:

    MS12341_0-1680694095774.png

     

     

    Thanks;

  • Nived_Nambiar Profile Picture
    18,138 Super User 2026 Season 1 on at

    It is working for me when i tried like this

    Nived_Nambiar_0-1680698260801.png

     

     

    could u share the code which u are trying ?

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

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 414

#2
11manish Profile Picture

11manish 335 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 274

Last 30 days Overall leaderboard