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 - Adding te...
Power Apps
Answered

AddColumns - Adding temporary Column to Collection cannot be used in Gallery

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi,

I am building a Dynamics 365 Custom Page.

I load the Order Lines Table from Dataverse and save it in a variable:

 

App.OnStart:
Set(OrderLinesData; Filter('Order Lines'; Order.'Order ID' = orderRecord.'Order ID'));; 
AddColumns(OrderLinesData; "SelectedQuantity"; 0)

 

 Additionally I am trying to add a "temporary column" "SelectedQuantity" which is initialized with a Value of 0.

I then display the OrderLinesData in a Gallery using the items property (works fine):

Serf_0-1648210217781.png

 I can successfully show all default Dataverse Columns, but I struggle displaying the value of my temporary column that I created:

Serf_0-1648209998525.png

It cannot resolve the SelectedQuantity attribute in the gallery.

It also does not work at Runtime. 

I believe I must be misusing the AddColumns function or I am missing something related to how variables/collections work.

 

I don't want to update any real value in the source Dataverse table, but just want to be able to freely work with the collection I am loading from Dataverse.

 

Any ideas? Thanks!

Categories:
I have the same question (0)
  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @Anonymous 

    Put the AddColumns() around the OrderLinesData as the Items property of your gallery. 

  • Verified answer
    Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Found out:

    AddColumns does not mutate the passed Collection, but rather returns an updated collection itself.

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 505

#2
WarrenBelz Profile Picture

WarrenBelz 502 Most Valuable Professional

#3
Haque Profile Picture

Haque 324

Last 30 days Overall leaderboard