cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
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.

Highlighted

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

Highlighted

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.

 

Highlighted

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

Highlighted

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.

Highlighted

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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (9,776)