cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Morke
Helper II
Helper II

ThisItem with multiple Collection Items

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?

3 REPLIES 3
timl
Super User
Super User

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

@Morke

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.

Helpful resources

Announcements
Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Government Carousel

New forum: GCC, GCCH, DoD - Federal App Makers (FAM)

In response to the unique and evolving requirements of the United States public sector, Microsoft has created Power Apps US Government.

Users online (1,935)