Hi
I'm trying to follow this tutorial:
http://powerappsguide.com/blog/post/generating-row-numbers
To show the row number of a collection in a gallery.
However, to use the value of that's tutorial colCollection.RowColumn, I need to put the colCollection in the "Item" property of the Data Card that's holding the gallery.
Since that data card is already using my main Collection in the "Item" property, I have to put both like this:
[mainCollection, colCollection]
However, this destroys my ThisItem references in the gallery that I use to show data from the Main Collection.
Is there a way of using two collections in the same Item property of a Data Card and be able to reference "ThisItem" to each collection?
Hi @Morke
To use this code, you would set the Items property of the gallery control to colCollection.
From within your data card, you'll be able to refer to the columns in mainCollection, in addition to the RowColumn column that you added.
That's what I expected, but the RowColumn is not being added to the Main Collection.
I think this is because this formula doesn't really add the column to the Main Collection, but just adds it to the Instance of the Main collection the formula is creating, so once the formula stops and creates the colCollection collection, the instance is deleted, and Main Collection stays as before
Assuming that mainCollection contains your source data, the formula copies that data to colCollection, and includes a RowNumber column. The formula never modifies mainCollection, so it will always stay as before.
Therefore, to display the row number, you would set the Items property of your gallery control to colCollection, rather than mainCollection.
To specifically answer your question - is there a way of using two collections in the same Item property of a Data Card and be able to reference "ThisItem" to each collection - the answer to this is no. A gallery can only have a single data source - it is not possible to set the data source of a gallery to 2 separate collections.