I'm using PowerApps to create a custom view form for a modern SharePoint list. I have a Gallery listing items related to the selected list item. Parent / child relationship works great, but I would like the first Gallery item to be selected by default.
This works maybe once the first time. Close (or hide) the view form, select a different list item and view details, first Gallery item (and no other items) are selected.
Does it work differently in SharePoint than stand-alone apps? Tried working with context variables but they seem to lag, they don't seem to get updated properly.
Screen1.OnStart = Clear(Collection1);
Screen1.OnVisible = UpdateContext({X:Gallery1.Selected.ID})
Screen1.OnHidden = Clear(Collection1);UpdateContext({X:Blank()})
Gallery1.Default = First(Collection1);