cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Oskarkuus
Post Prodigy
Post Prodigy

Gallery losing selection?

When i run commands like SubmitForm or Select()

My gallery on the screen is losing its selection.

 

Why?

 

How can i force the gallery to keep it current selection?

 

 

6 REPLIES 6
eka24
Super User III
Super User III

You can set a variable on the OnSelect of the Submit button: 

Set(MySelectedItem, GalleryName.Selected)

 

Then in the Default of the Gallery put:

MySelectedItem

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

It does not work.

The gallery is still unselected.

 

I press a button where i have this code

 

submitform(form1) & set(defselection;gallery1.selected)

 

then in gallery1 i have in default : defselection

 

but the gallery is not keeping it´s selection

 

tested this by adding a label with the code: gallery1.selected.title

and the label is blank

Please copy and paste exact code you have. Should be:

 

SubmitForm(form1);Set(defselection,gallery1.Selected)

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

 

Ok i have done a new example.

 

this is my exact setup

 

1. User press a row in a gallery and loads a form with data. Form have the gallery.selected as item so it is populated by the selected row in the gallery.

 

2. User do edits in form and press a save button that says SubmitForm(Form1) & Set(defselection:Gallery1.Selected)

 

When user press this button, the form is submitted. The gallery selection is reset to nothing selected.

 

I must use an & sign between submitform and set, doing it like you are with just ; does not work. I get an error.

 

The default command on Gallery1 is set to defselection

Please don't use &.

What I sent didn't include that. It won't work if you do that. Use what I sent you

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

When i write ; and not & i get an error that says "unexpected sign"

But i can change to ;; instead of the &

 

However this does not change anything for me.

 

 

But i think i figured out what the issue is.

I have a filter on my Gallery in Items.

The filter looks like this:

 

Filter(OskarTestar20200314;
User().Email='Skapades av'.Email Or User().Email in Ägare.Email;TextInput3.Text in Rubrik Or TextInput3.Text in Concat(Medlemmar1;DisplayName) Or TextInput3.Text in Concat(Ägare;DisplayName))

 

If i remove my filter and just display the datasource, then everything works just fine and i have no issues atall with the gallery being deselected.

 

Can this filter be the problem?

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

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Solution Authors
Top Kudoed Authors
Users online (27,406)