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 / Add column to collection
Power Apps
Answered

Add column to collection

(0) ShareShare
ReportReport
Posted on by 25

Here is what I currently have, collecting only one row of a Sharepoint list.

Collect(SRItemsCollection,Filter('Supply Request Items',ID=ThisItem.ID))

 

I would like to add a column "Action" to that collection and assign it a value. When I put an AddColumns in that statement it collects all rows from the Sharepoint list.

Categories:
I have the same question (0)
  • Pstork1 Profile Picture
    69,657 Most Valuable Professional on at

    Use the addColumn() directly on the data source inside the Collect statement.  That will add the column and then filter it down to one record.

    Collect(SRItemsCollection,
    AddColumns( TempCol, 
    	"ColumnToAdd", 
    	Filter('Supply Request Items',ID=ThisItem.ID) 
    ))

     

  • Deeply Profile Picture
    25 on at

    I used the name of the Sharepoint List for TempCol, is that correct?  When I do it still collects all items from the Sharepoint list.

  • Pstork1 Profile Picture
    69,657 Most Valuable Professional on at

    No,  that is a temporary collection that will hold the filtered results from the sharepoint list (I assume its 'Supply Request Items').

  • Verified answer
    v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    Hi@Deeply,

    Based on the issue that you mentioned, do you want to collect a certain row from your SP list and add a column "Action" to be assigned a value?

    Could you please share a bit more about the scenario, do you only want to collect a row rather than all rows from your SP list?

    I want to explain to you that AddColumns() function could only add columns to a collection with the Collect function. You can't modify the columns of a data source by using these functions. You must modify the data at its source. 

    I have a test on my side, please take a try as below.

    Collect(
     FinalCol,
     AddColumns(
     Collect(
     SRItemsCollection,
     Filter(
     'Supply Request Items',
     ID = ThisItem.ID
     )
     ),
     "Action",
     "Value"
     )
    )

    57.png

    Regards,

    Qi

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