web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Create columns in exce...
Power Automate
Unanswered

Create columns in excel table dynamically. And, How to read an excel table row-wise and then column-wise for each row, and send data to SQL table

(0) ShareShare
ReportReport
Posted on by 2

Hi All,

 

I have an excel file which has a fixed number of columns, from where I read row by row in Power Automate when I am trying to upload its contents. But now, I want to have the number of columns in my excel file to change/add columns depending upon a numerical value obtained which is a difference between a current date and the date provided (i.e. Number of Days). 

 

For example, I have 5 fixed columns in my excel file. Now, my current date is December 1, 2021 and date provided is December 10, 2021. So, Power Automate should create (10-1)+1 columns extra in my excel with the dates as headers. 

 

After this file is created, and the records are updated, I want to read this excel table in such a way that Power Automate reads the static data column values of each row and for that row it reads the value against the dynamic Date columns and sends the data to SQL procedure. 

 

Thanks & Regards,

Aditya 

 

 

 

Categories:
I have the same question (0)
  • ScottShearer Profile Picture
    25,278 Most Valuable Professional on at

    @adibaba07 Please see these two blog posts as they might help.

    Adding columns not supported

    Adding a key column

     

     

  • jedunn Profile Picture
    123 Microsoft Employee on at

    If I understand your scenario correctly, I believe you could create a flow that has the Excel Run Script action to run an Office Script. This script can accept parameters from previous flow steps and evaluate date conditions to determine the number of columns to add. Then it would use the addColumn() interface to add the columns. You may have other steps in your flow that send data to SQL.

     

    If that sounds like a feasible route, learn more about Office Scripts to get started.

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
trice602 Profile Picture

trice602 237 Super User 2026 Season 1

#2
David_MA Profile Picture

David_MA 176 Super User 2026 Season 1

#3
Power Platform 1919 Profile Picture

Power Platform 1919 96 Super User 2026 Season 1

Last 30 days Overall leaderboard