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

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

(0) ShareShare
ReportReport
Posted on by

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

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