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 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,228 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

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 Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard