cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
danchircop
Level: Powered On

Selected Item

Hi,

I'm trying to find a way so that when I submit a new item(using a form), the new item becomes the selected item in the gallery. I'm also using the TemplateFill to highlight a selected item. Is it possible to achieve this?

 

Thanks

Dan

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Selected Item

If you try Reset('GalleryName') instead of Refresh() then it will select the first item in the gallery or at least it did in the quick test I did. 



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.
4 REPLIES 4
Super User
Super User

Re: Selected Item

You could try sorting the gallery by created (descending), so that the new item becomes the first item in the list and when a gallery refreshes it by default selects the first item. You might also need to refresh the data source that is being used in the gallery after the form has been successfully submitted.  



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.
danchircop
Level: Powered On

Re: Selected Item

Hi,

 

Thanks for the reply. The gallery is already being sorted. Actually the user has the option to sort both in ascending and descending.

I agree that when sorting in descending order, it does put the new item on top of the gallery list however it does not become the selected item not even if I refresh the source unless the user would have selected the first item before making a new entry. 

 

This is also a little bit of an issue when sorting the gallery. When a sort is applied a previously selected item doesn't remain selected. So for example, if I select the third item in a gallery and apply a sort, the selected item will shift to a different row however the selection/template fill will remain fixed to the third row. So a selection always seems to remain fixed to a row rather than an item.

 

Thanks

Dan

Super User
Super User

Re: Selected Item

If you try Reset('GalleryName') instead of Refresh() then it will select the first item in the gallery or at least it did in the quick test I did. 



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.
danchircop
Level: Powered On

Re: Selected Item

Excellent. Reset did the trick. 

Helpful resources

Announcements
firstImage

PowerApps Monthly Community Call!

Join us next Wednesday for our Demo Extravaganza, October 16, 2019 8am PDT.

firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 366 members 4,694 guests
Please welcome our newest community members: