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 Apps / AddColumns error - Col...
Power Apps
Unanswered

AddColumns error - Column name already exists

(0) ShareShare
ReportReport
Posted on by 49

I am trying to add some columns to a collection using the AddColumns function. The second argument - Column Name - returns the error: "Column name already exists".

It has started happening recently. Previously the same code was working fine.

Here is the syntax:

Clearcollect(col_bills, AddColumns(Gallery.AllItems,"NewColumn", "TestVal"))

Categories:
I have the same question (0)
  • victorcp Profile Picture
    2,350 Moderator on at

    Hi,

    Problably you already have that column, if you want to override it, you can do this:

    ClearCollect(col_bills, AddColumns(DropColumns(Gallery.AllItems,"NewColumn"),"NewColumn", "TestVal"))

    But I suggest changing the name of NewColumn.

     

    I hope it helps 🙂

  • sahana_23 Profile Picture
    46 on at

    Hii, Can you use this formula and try it once,

    ClearCollect(col_bills, AddColumns(Gallery.AllItems,"NewColumn" & Text(Rand()), "TestVal"))

  • iAm_ManCat Profile Picture
    18,256 Most Valuable Professional on at

    @sahana_23 That is not a valid Power Apps formula, the column name has to be a text literal - plus even if you could add a random value to the column name after every time you collect something, then you will never be able to refer to that column name in your App as it will change every time

     

    Did you try this formula yourself or is this what the AI suggested - AI models are currently particularly bad at PowerFx, so I would not recommend using them for PowerFx

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 536

#2
WarrenBelz Profile Picture

WarrenBelz 426 Most Valuable Professional

#3
Haque Profile Picture

Haque 305

Last 30 days Overall leaderboard