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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / How to remove extra co...
Power Automate
Answered

How to remove extra columns from datatable added automatically

(1) ShareShare
ReportReport
Posted on by 43
hi , 
 
i have 11 columns in my excel sheet but when i am using read data from excel sheet the extra columns added automatically ..like column 1 , column 2 like that in datatable .
 
How to remove these extra columns which added randomly
 
I have the same question (0)
  • mathiaskjeldsen Profile Picture
    224 on at
    Hey Kanha
     
    Can you share a picture of what you are experiencing?
     
    Best regards
    Mathias Kjeldsen
  • Verified answer
    VishnuReddy1997 Profile Picture
    2,656 Super User 2025 Season 2 on at
    Hey Hi,
     
    Please find the solution.
     
     
    Code:
    Excel.LaunchExcel.LaunchAndOpenUnderExistingProcess Path: $'''C:\\Users\\Desktop\\Power Automate Desktop\\Practice\\Excel\\input.xlsx''' Visible: True ReadOnly: False Instance=> Input_ExcelInstance
    Excel.ReadFromExcel.ReadAllCells Instance: Input_ExcelInstance ReadAsText: False FirstLineIsHeader: False RangeValue=> Input_ExcelData
    SET ColumnValue TO 0
    LOOP FOREACH CurrentItem_InputData IN Input_ExcelData[0]
        IF IsEmpty(CurrentItem_InputData) THEN
            Variables.DeleteColumnFromDataTable.DeleteColumnWithIndex DataTable: Input_ExcelData ColumnIndex: ColumnValue
        ELSE
            Variables.IncreaseVariable Value: ColumnValue IncrementValue: 1
        END
    END
    
     
    (Note:- if you got your solution you can mark as solution and gives kudos)

    Thanks & Regards
    Vishnu Reddy

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…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard