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 / Hiding controls into a...
Power Apps
Answered

Hiding controls into a gallery depending of the dropdown choice

(0) ShareShare
ReportReport
Posted on by 65

Hi! I hope that everyone who read this post is having a good day,

I need help with the next problem:

I have a gallery with different rows.
Each item has the option to attach a document, however, I want the attach document option (yellow plane) to be visible only for the first row that has the same number of the dropdown list.

For example:

In the image below, both rows have different number selected in the dropdown list, therefore, in both rows the yellow airplane icon is visible.

Crissceron_0-1693933879533.png

 

Thats means, each items should have a different document.


However, if both dropdown lists of each row of the gallery have the number "1", I want that only the first row of the gallery that has the same number, the yellow airplane icon is visible.

Crissceron_2-1693933210082.png

So, for both items with the selected number 1, its means that should have the same document for both of themm

 

The idea is to assign the same document for multiple items at the same time but depending of the selección in the dropdown list.

In this case i only have 2 rows, but imagine with multiple rows and if i have to attach differents documents for multiple groups of people, this would help a lot.

 

Thanks!.

 

 

 

 

 

Categories:
  • LaurensM Profile Picture
    12,516 Moderator on at

    Hi @Crissceron,

     

    Does your datasource or collection behind the gallery store the number value or is the dropdown selection not linked to a particular column? 

  • Crissceron Profile Picture
    65 on at

    It is linked by the next code: 

     

    With(
    {
    wList:
    Filter('Gestion de pasajes';Numero_documento=Pedido)
    };
    ForAll(
    Sequence(CountRows(wList));
    Patch(
    Index(
    wList;
    Value
    );
    {RowNo: Value}
    )
    )
    )
    

    Im using that code in the items property of the gallery to assing a correlative value to each row.

    So, in the dropdown default property im using ThisItem.RowNo

     

    But, it can be modified anyways.

     

  • Verified answer
    LaurensM Profile Picture
    12,516 Moderator on at

    Thank you for the code @Crissceron! Would it be a possible in your case to collect this data to a collection (e.g. during the OnVisible of your screen). Using a collection would allow us to keep track of the current number selection by patching during the dropdown OnChange.

     

    (1) E.g. during OnVisible of that screen

    ClearCollect(
     colList;
     With(
     {
     wList: Filter('Gestion de pasajes';Numero_documento=Pedido)
     };
     ForAll(
     Sequence(CountRows(wList));
     Patch(
     Index(wList; Value);
     {RowNo: Value}
     )
     )
     )
    )

     

    (2) Keep track of number changes by using the following code in the dropdown OnChange:

    Patch(colList; ThisItem;{RowNo: Self.Selected.Value})

     

    (3) Change the yellow plane Visible property to:

    ThisItem.ID = LookUp(colList; RowNo = ThisItem.RowNo).ID

    Please change .ID to a unique column of that row. I tested this via a SharePoint list - hence the ID column was used.

    The yellow plane will now only show for the first record with the given number selection.

     

    If this solves your question, would you be so kind as to accept it as a solution & give it a thumbs up.

    Thanks!

  • Crissceron Profile Picture
    65 on at

    @LaurensM 

    Thanks for your response... unfortunately, it is not working for me...

    If I select in the first row the number 1 and then the second row the number 1 again, then it is only showing the button in the first rows, thats right, but then if i go back to the second row and i put the number 2 into the dropdown, then the button should appear again. 

    so, thats means that something is not working. 

    Do you have something else in mind?

  • LaurensM Profile Picture
    12,516 Moderator on at

    Hi @Crissceron,

     

    The code is working correctly on my end. However, what I notice from the screenshot is that all rows look exactly alike. Is there a unique column that distinguishes each row, because otherwise the Patch will not work correctly. 

     

    Additionally, what are the dropdown Items and Default properties?

  • Crissceron Profile Picture
    65 on at

    You are right, i added a filter to the patch function in the OnChange property of the Dropdown to select the correct row and everything works as expected.

     

    Thanks for your help.

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 405 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 368

#3
WarrenBelz Profile Picture

WarrenBelz 244 Most Valuable Professional

Last 30 days Overall leaderboard