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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Gallery Default Select...
Power Apps
Unanswered

Gallery Default Selected Items not Select Line When I Click on Button Status

(0) ShareShare
ReportReport
Posted on by 253

Hi Guys!
I have the follow issue below:

After I submit a Form (that get input from selected/linked gallery), my gallery return not selected.

My variable in "Onselect" button property: << it's ok
I have two filter buttons with UpdateContext. One is "UpdateContext({varStatus: "Pendente"})" and another one is "UpdateContext({varStatus: "Concluído"})". 

 

My formula in "Item" Gallery property: << it's ok

Filter('Processo de exportação', StatusGeralzao = varStatus)

 

My problem is: when I click on both buttons filters (varStatus = "Pendente") or (varStatus = "Conluído") , the gallery is filtered by "Status this status normally, but not select its line automatically. I have to click to select an specific line.

I use the "default" gallery property to see the last record (just to stay selected) like this: Last(Database) and the result selected the last line in my gallery when I click on the button  (varStatus = "Pendente"), but when I click on button  (varStatus = "Concluído"), the gallery doesn't select the last gallery line. 

 

Does Anyone could help with this issue, please? Any If formula or anything else on default gallery property?


@LaurensM @Shavar_Scott @RandyHayes @Drrickryp @Akser @mdevaney 

Categories:
I have the same question (0)
  • Shavar_Scott Profile Picture
    175 on at

    @WendeReisss 

     

    Try this:

     

    Add a dropdown with two options (choices) : Pendente or Concluído . 

     

    Shavar_Scott_0-1675813870204.png

     

    Add this line of code to your filter 

     

    Filter( <DatasourceName>, Dropdown1.Selected.Value in Status || IsBlank(Dropdown1.Selected.Value)

    Shavar_Scott_1-1675813984118.png

     

    Example when no status is selected

     

    Shavar_Scott_2-1675814016716.png

     

    Example when Pendente is selected

     

    Shavar_Scott_3-1675814042143.png

     

    Example when Concluído is selected

     

    Shavar_Scott_4-1675814063334.png

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

     

  • WendeReisss Profile Picture
    253 on at

    Hi @Shavar_Scott 

    I have two buttons that filter the gallery. My Problem is not that. 

    My buttons filter gallery, but doesn't select the gallery line automatically. It's select gallery line ("templatefill" property) just if I click on specif line of gallery.

  • Shavar_Scott Profile Picture
    175 on at

    @WendeReisss ,

     

    Try this:

     

    On the TemplateFill property of the gallery insert the code: 

     

    If(Self.IsSelected, <Color if Selected>, <Color if not Selected>)

     

     

    Shavar_Scott_0-1675866587859.png

     

    Also, try leaving the Default property of the Gallery blank:

     

    Shavar_Scott_1-1675866743175.png

     

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • WendeReisss Profile Picture
    253 on at

    Hi @Shavar_Scott 

    I've already do this. It works well. My problem is when I submit my gallery information, the line of gallery that was in grey stay not selected automatically. So, I have to click on it to be selected again.

  • Shavar_Scott Profile Picture
    175 on at

    @WendeReisss ,

     

    The only thing I can think of that is might work is to Reset the gallery after you submit your gallery information. Try the below code after you submit your gallery info.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Reset(<name of gallery>)

     

     

     

  • WendeReisss Profile Picture
    253 on at

    @Shavar_Scott 
    Which property can I use "Reset(<name> ofgallery>).

    Default gallery property or in Onselect button property?

  • Verified answer
    Shavar_Scott Profile Picture
    175 on at

    @WendeReisss ,

     

    Place the code in the OnSelect property of both buttons:

     

    So for the Pendente Button's Onselect property try:

    UpdateContext({varStatus: "Pendente"});
    Reset(Name of Gallery)

     

    Same for Concluído button

    UpdateContext({varStatus: "Concluído"});
    Reset(<name of gallery>)
  • WendeReisss Profile Picture
    253 on at

    Thank you so much @Shavar_Scott !

    Finally someone helped me solve this issue.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard