web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Default gallery item a...
Power Apps
Answered

Default gallery item always selected

(0) ShareShare
ReportReport
Posted on by 42

Hi 

 

I have a searchbox1 and a gallery1. with sharepoint lookup.

 

if i click an item it then goes to page 2 that uses the selected item to search in galery 2 the second page in a second sharepoint list.

all good. 

 

but.... if i put a button to navigate to the second page without selecting anything in gallery 1 it defaults to gallery1s first item

 

I have tried all kinds of things to stop it setting default to {} didnt work. I tried resseting gallery1 on the click to go to page 2. still no dice. also tried filtering on the search box

[code]

If(
IsEmpty(Location_Gallery_1.Selected.AreaCode),"", )

[/code]

 

im a bit lost on how to stop something that would seem to be silly.

When im testing it in the app editor it isnt doing it. but on the actual app it is. 

 

any idea of a way to stop it or clear it? 

 

 

 

 

 

 

 

Categories:
I have the same question (0)
  • BCBuizer Profile Picture
    22,654 Super User 2026 Season 1 on at

    Hi @jacktherip ,

     

    What is it you expect to happen when navigating to screen2 without selecting any item in the gallery?

     

    The only scenario where a gallery does not have a selected item, is when it doesn't have any items in it at all, so you may have to rethink your design a bit.

  • NandiniBhagya20 Profile Picture
    4,667 Super User 2024 Season 1 on at

    When you click on the button, do you want user to navigate to page 2 with Gallery2 showing all items (without gallery1 filter) ?

  • jacktherip Profile Picture
    42 on at

    Hi, what i expected was it to show no items or all items. preferably non as I expect all will mess up the text box.

    just one random item that happens to be at the top of a list isnt so helpful 🙂

  • jacktherip Profile Picture
    42 on at

    Hi, yes all items would be nice but as the checkbox is just a text box to search the other list.

    I would prefrer non as the return really 

     

  • NandiniBhagya20 Profile Picture
    4,667 Super User 2024 Season 1 on at

    Hi @jacktherip ,

    Then you will have to use collection to store data that you are going to display in page 2 gallery.

    On button click you can use ClearCollect(colGal2Items, SPListAssociatedWithGal2)

    And when you select any row in your gallery1 you can use below formula on select property on Gallery1:

    ClearCollect(colGal2Items, Filter(SPListAssociatedWithGal2, <your filter condition that you are currently using>))

  • Verified answer
    jacktherip Profile Picture
    42 on at

    Ahh yes good idea

    i just thought of another way possibly and that is to insert a record at the top of the gallery that is blank and use that as the default. 🙂

  • cwebb365 Profile Picture
    3,294 Most Valuable Professional on at

    Easier way here is just set your filter on page 2 to a varSelectedItemID or whatever you are filtering on. And set it with an OnSelect of your first gallery using Set(varSelectedItemID,Self.Selected.ID). That way, you are not basing it on the current selected item of the gallery, but an action from the first one. This way you control that selection using the variable. 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 551

#2
WarrenBelz Profile Picture

WarrenBelz 430 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 298

Last 30 days Overall leaderboard