cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
misc
Resolver II
Resolver II

How do I auto-select the first item in a gallery?

This post is tangentially related to this one I made the other day.

 

Essentially, someone gave me a fix which I have worked with to make sure that reference numbers are never doubled up on, however, this fix relies on a gallery (TicketsArchiveGallery) to have the first item 'selected'. This gallery however is 'hidden' on a page of the app the user should never see - it's just there to help me reference the ID number for the new reference number, this means that where my reference number is worked out using the following formula:

 

 

If(TicketsArchiveGallery.Selected.IDStatic >= varID, TicketsArchiveGallery.Selected.IDStatic + 1, varID)

 

 

If I have not 'Selected' record in the gallery it still doubles up reference numbers in certain situations. 

 

My gallery is filtered so it's descending by the IDStatic number:

 

SortByColumns('Tickets Archive', "IDStatic", Descending)

 

 

Is there any way to 'Select.Parent' of the top item in a gallery when another screen is OnVisible (or the app on-start, even)? Is there a better solution to this?

 

 

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User III
Super User III

@misc 

Set your Default property to : First(Self.AllItems)

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

View solution in original post

1 REPLY 1
RandyHayes
Super User III
Super User III

@misc 

Set your Default property to : First(Self.AllItems)

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

View solution in original post

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (2,503)