
Announcements
I have a single page app that has a gallery on it and a view form.
I'm trying to get the first record of the gallery selected when the app loads AND have the View Form show that record's data.
The Gallery's OnSelect is
Set(varThisCase,LookUp('Test List',Title=ThisItem.Title))
(Title is my unique field)
The ViewForm's item property is varThisCase
In the screen's OnVisible, All that's in there is Select(Gallery1,1).
Here's what's happening:
When the app starts, I get an error that says "Row or column passed to the Select function is outside the bounds of the gallery items"
If I ignore the error and select a record in the gallery, it shows me the record in the Viewform.
I put in an additional test page with 1 button on it that clears the varThisCase variable and Navigates back to the main page. When that navigation happens, I don't get that same issue with the Row or column passed being outside the bounds of the gallery items, the first record gets selected (as expected) and the record is shown in the viewform.
It appears that the gallery bounds issue only happens when the app is first launched.
What possible workarounds do I have here to:
I've looked at several different ways of selecting that first record (including setting the Gallery's Default to First(Gallery1.AllItems). Nothing seems to work. 😞
Hi @zuurg ,
You were close to the idea in your last statement. You did not post what the Items of the gallery or your data source, however you can do this at AppOnStart or Screen (Gallery) OnVisible using the full code of your Gallery Items
Set(
varThisCase,
First(
YourGalleryItemsHere
)
)
Then the Default of the Gallery
varThisCase
Your Form is already set correctly.
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
MVP (Business Applications) Visit my blog Practical Power Apps