0

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);

1
  • The trigger is probably the problem; OnVisible is just that, on visible, not to be confused with on all form elements successfully loaded... now that would be handy. Commented Jun 5, 2018 at 3:16

1 Answer 1

1

On Gallery, Set your Default property to:

First(Self.AllItems)

Or

OnVisible Of Screen:

Set(var,First(galleryname.AllItems))

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.