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

