Hopefully a quick solve here, but I am trying to find the max value (actually a date) stored in labels in a gallery.
Using the following, the return is always "0""
Max(
Gallery1_3.AllItems,
Label2_12.Text
)
Yes, this is a true statement. If the gallery is paging (delegable simple formula) then referencing AllItems will only ever contain all the records *currently* in the gallery table.
Considerations everywhere to always be make in the design! 😉
This may/may not be relevant but I believe this will only work for the rows that are currently showing in the gallery.
If the items property of the gallery is delegable, the gallery will load records in batches of 100 (the next batch being fetched as you scroll to the end of the current batch), so if you have a delegable source for the gallery and more than 100 rows and you haven't physically scrolled to the end, you will only get the Max of those 100 records currently in the gallery, not all records in the source.
I've seen folk get caught out with this when building there App against a small set of test data and then find that it won't scale to larger datasets.
makes sense - i wasnt thinking about the max or min applying to numbers. i will give this a try an then accept as a solution
The formula @Drrickryp provided will give you the max date value. You cannot use the Max or Min functions on a date like you were. The trick is to just sort in your formula and take either the first or last depending on if you want max or min.
The formula is not going to sort your gallery, just give you the max value.
hi @Drrickryp - i actually dont want to sort the gallery, im trying to find the actual max value of the field. hope that helps to clarify
First(Sort(Gallery.AllItems, datefield, Descending).datefield
WarrenBelz
146,745
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
66,091
Most Valuable Professional