Reputation: 449
I have a gallery connected to an Excel table. I want to add some of the gallery columns to a collection. I am doing-
ClearCollect(Attgallery,ShowColumns(Gallery3.AllItems,"Name","Language","Mentor","Type",Dropdownatt.Selected.Value));
The last column that I am adding here is a dropdown value which is giving me the error. The dropdown is a new column which was not present in the Excel table. How do I add it to the collection?
Edit: I tried changing my code.
ClearCollect(Attgallery,ShowColumns(Gallery3.AllItems,"Name","Language","Mentor","Type"));
ClearCollect(Finalcollection,AddColumns(Attgallery,"Attendance",Dropdownatt.Selected));
Now the collection is getting created, but from the dropdown values only the last value that was selected is being assigned to every row of the collection.
Upvotes: 0
Views: 4505
Reputation: 547
Here is some pseudo code that shows an approach with ForAll:
clear( YourCollection );
ForAll(
Gallery.AllItems,
Collect(
YourCollection,
ThisRecord.Dropdownatt.selected,
....
https://learn.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-forall
This links gives some information. Basically you should collect every row with it's associated dropdown value. ForAll is useful for this.
Upvotes: 0