Hi All,
Out of curiosity - I have read in many places that collection can be initialised and data cane be populated in different actions/events of the PowerApps. I want to pre-populate a veritcal gallery when the app runs and screen is visible - but can't find it easily.
Here is my question and I need to know why in two places the collection is not created and data is not populated. Here is my explanation:
Fig: Stationery collection data
I tried to initialise the collection at the “OnStart” event of the App.
Fig: Variable is created but data is not populated
Empty vertical gallery on the screen (After running the app), since there is no data, hence it’s not showing anything!
Then I moved the stationery collection variable initialisation from App’s OnStart event to Screen’s OnVisible event like below:

When I run the app, still I see no data is filled in the collection, but variable is created.
I moved the collection initialisation at OnSelect event of a button and run the application it works (data is populated and vertical gallery shows the data) when I click the button.
I need to know – why in the App’s OnStart event, and Screen’s OnVisible event collection data is not populated but variable is created. And what I need to do to initialise the gallery at the application start time. Please make me sage.
Thanks in advance.