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 / Referencing Values in ...
Power Apps
Answered

Referencing Values in Collections

(0) ShareShare
ReportReport
Posted on by 54

In the use of collections, I am finding the ability to reference values in them very unintuitive.

Even with the intellisense formula bar showing "Table" or "Record" or other primitive to complex data type, I came up with what I wanted only by ultimately stumbling upon it after several hours (!).

In one screen, a button was used with following OnSelect formula:

 

 

 

UpdateContext({MeetingDate: MeetingDatePicker.SelectedDate});
ClearCollect(AgendaCreate, {MeetingDate: MeetingDate, AgendaItems: 'CAB Agenda Admin'.'Level 1 Header'});
Navigate(EditAgendaItems,ScreenTransition.Fade)

 

 

 

In an image below, the collection shows a property (column?) "MeetingDate" with datetime value and a property "AgendaItems" shows a table, which is expanded to show a single column of rows of text.

In the next screen, these two properties (columns?) are utilized, the date converted to text and concatenated to
text in a text label

 

 

 

"Meeting Date: " & Text(First(AgendaCreate.MeetingDate).MeetingDate, DateTimeFormat.ShortDate)

 

 

 

and the single column table of text used to form the options in a scrollable list box.

 

 

 

First(AgendaCreate.AgendaItems).AgendaItems

 

 

 

The image of the screen and selected controls with their formula are indicated.


I have a feeling I am doing this wrong, because the patterns

 

 

 

First(AgendaCreate.MeetingDate).MeetingDate
First(AgendaCreate.AgendaItems).AgendaItems

 

 

 

are confusing. This states that AgendaCreate.MeetingDate is of type 'Table' when it seems not to be, and that it nonetheless returns a value of type 'Record' where we get the field 'MeetingDate'.

AgendaItems is clearly a property of collection AgendaCreate, and is intuitively a table, but First() returns a record that is a table. Seemingly a table within a table, which is not the case.

 

Why doesn't AgendaCreate.MeetingDate simply return the datetime value and AgendaCreate.AgendaItems.(columnName?) return the rows of text to be used as Items?  That seems intuitive to me.

 

-------------------------------------------------------------------------------------------------------

 

Fig1.pngFig2.png

Categories:
I have the same question (0)
  • Verified answer
    v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @StevePenner :

    It looks like you have already got the value you want.

    Do you just want to know why you should use 

     

    First(AgendaCreate.MeetingDate).MeetingDate

     

    instead of

     

    AgendaCreate.MeetingDate

     

    ?

    The point is  the value of AgendaCreate.MeetingDate is a list of datetime value.If you need to get a specific MeetingDates, you need to specify which record it comes from.So you can use 

     

    First(AgendaCreate).MeetingDate

     

    or

     

    First(AgendaCreate.MeetingDate).MeetingDate

     

    to get the MeetingDate in the first record in the table AgendaCreate.

    Then,let‘s go back to the agendaitems field.

    AgendaCreate.AgendaItems is a list of tables.So the value of 

     

    First(AgendaCreate.AgendaItems).AgendaItems

     

    or

     

    First(AgendaCreate).AgendaItems

     

    is a table in AgendaItems field in the first record of the table AgendaCreate .So it can be used as items property of the list box control.If you want to display it in a label control,you can try this :

    Add a label control and set it's Text property to:

     

    Concat(First(AgendaCreate).AgendaItems,Title,Char(13))

     

    Best Regards,

    Bof

     

     

     

  • Omaphil1890 Profile Picture
    3 on at

    This option

     

    First(AgendaCreate).AgendaItems

     

    works perfectly for me.

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!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 549 Most Valuable Professional

#2
Kalathiya Profile Picture

Kalathiya 225 Super User 2026 Season 1

#3
Haque Profile Picture

Haque 224

Last 30 days Overall leaderboard