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 / The Function "Add Colu...
Power Apps
Answered

The Function "Add Column" has some invalid arguments

(0) ShareShare
ReportReport
Posted on by 428

Hi All, 

 

Trying below to add column in collection but getting error The Function "Add Column" has some invalid arguments 

 

ClearCollect(POAGrantorSocietyChange,
 AddColumns(POAGrantorSocietyChange,"Grantor",LookUp(
 POAGrantorSocietyCollection,GrantorSociety=Dropdown4_1.Selected.Result))
);
Categories:
I have the same question (0)
  • eka24 Profile Picture
    20,925 on at

    Your LookUp does not have a return column. Check the end of the LookUp formula.

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Ashok2 

    The formula looks good as long as you are expecting that Grantor will be a record. 

    So, the question would be, in the formula editor, there is most likely something that is underlined in red a little darker, look at that and see what the error is on that part.  

    When a formula has an inner issue (like in your LookUp) it will report that the outer function (in this case AddColumns) has invalid arguments. 

    I would focus on the LookUp function and see if you are comparing text to text (i.e. the GrantorSociety and the dropdown result).

     

    I hope this is helpful for you.

  • Verified answer
    v-albai-msft Profile Picture
    Microsoft Employee on at

    Hi @Ashok2 ,

    Do you want to add a column called “Grantor” into the collection POAGrantorSocietyChange?

    If yes, we cannot use formula like this "ClearCollect(POAGrantorSocietyChange,

    AddColumns(POAGrantorSocietyChange, XXX)". It is not allowed to ClearCollect a collection based on itself.

    Instead, you can add a new record into this collection which has a value only for this new column “Grantor”. Then remove the new added record, this time, your collection will have this new column.

     

    For example:

    If you want this new column contains a record, you can try this:

    Collect(POAGrantorSocietyChange,{Grantor:LookUp(POAGrantorSocietyCollection,GrantorSociety=Dropdown4_1.Selected.Result) });
    
    Remove(POAGrantorSocietyChange,Last(POAGrantorSocietyChange));
    
    UpdateIf(POAGrantorSocietyChange,true,{Grantor: LookUp(POAGrantorSocietyCollection,GrantorSociety=Dropdown4_1.Selected.Result)})

     

    If you want this new column only contains text, you can try this(Using lookup function to return a column value, then update this value to Grantor column):

    Collect(POAGrantorSocietyChange,{Grantor:”1”});
    
    Remove(POAGrantorSocietyChange,Last(POAGrantorSocietyChange));
    
    UpdateIf(POAGrantorSocietyChange,true,{Grantor: LookUp(POAGrantorSocietyCollection,GrantorSociety=Dropdown4_1.Selected.Result).Title})

    Best regards,

    Allen

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 214 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 185

Last 30 days Overall leaderboard