Challenge #4
Collecting items in a collection is a very common use case, and is often times done on the first screen of the app so the collection can be used throughout the rest of the app. However, if this is being done on the OnStart of the app or on the OnVisible property of the first screen, the collection remains empty. To test this out, add the following formula in the OnStart of the app or on the OnVisible property of the first screen of your app and also add a label that shows the count of records in the collection (for validation) and set the Items property of a gallery to the collection.
ClearCollect(conColl, [@ModelDrivenFormIntegration].Item.Contacts)
Trick #4
If items need to be collected on the first screen and cannot be put off until any subsequent screen, then the collection process should start on some kind of a trigger. A couple of examples of triggers are:
- OnClick of a button (although not very desirable from a usability perspective)
- OnTimerStart or OnTimerEnd of a timer control
I have used the button option to illustrate this trick.
Have fun! Get addicted!
Oh man, thanks a lot, this post saves my day