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 / Show a container when ...
Power Apps
Answered

Show a container when clicking icon and add attachments inside from SP list row

(0) ShareShare
ReportReport
Posted on by 943 Season of Giving Solutions 2025
Hi!
 
The idea is to open a container with requirements and instructions. So when click that button, it opens a container but the question now is, how I can difference the instructions from requierments if I add them both in the same row. I would want it to be shown like separate, I show you the picture:
In documentació de preparació I have the icon that opens the container (at the moment it's shown all the time), so the thing is to have the file names of the "Recomanacions" and "Instruccions" below each. The X icon is to close the container. It could be great that it has a background color so it doesn't mix both container information.
The other thing is, that documentació de preparació and the icon, only has to be show if one of the columns in the SP lists is YES (or true). In case that there are no attachments, it doesn't have to be shown. If the left text label is no, the icon and text label documentacio de preparació should be hidden. 
How can I separate instructions from requierments and make that part visible and hidden?
 
Thanks a lot!!
Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    155,838 Most Valuable Professional on at
    Firstly instead of using a Horizontal or Vertical Container, use a plain Container (the last option) and you can put your control wherever you want. I do not know if you have a Form in there or individual controls, but you can set the Visible of the control you want hidden if there are no attachments (assuming you have selected whatever you have from a Gallery), set the Visible to 
    CountRows(
       LookUp(
          SPListName,
          ID = Gallery.Selected.ID
       ).Attachments
    ) > 0
     
    Please ✅ Does this answer your question 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 answering Yes to Was this reply helpful? or give it a Like ♥
    Visit my blog
    Practical Power Apps    LinkedIn  
  • Charlie Martharper Profile Picture
    943 Season of Giving Solutions 2025 on at
     
    Ok, that make the container appears when the row has attachments, but now, how do I introduce that attachment into the container?
    In the case that I have 2 differents type of files, can I divide them (like instructions or requierements)? Is there a way to do it?
    When click on the X, it doesn't close the container: (container1 is the name of that container)
    UpdateContext({varShowContainer1: false})
    This is what I have OnSelect
    Thanks for your help!! That worked and make it visible or hidden if it has or not attachments.
  • Verified answer
    WarrenBelz Profile Picture
    155,838 Most Valuable Professional on at
    I am still guessing a bit here on what exactly you have there, but if you want to display a working attachment control inside that pop-up, put an Edit Form inside the container with the DataSource of your SP List, the Item
    LookUp(
       SPListName,
       ID = Gallery.Selected.ID
    )
    and add the Attachment field only to the Form. If you only want to view or download the attachments, leave it in View Mode. If you want to add/delete attchments, put it in Edit Mode and submit the Form.
     
    On the container visibility, you really need an icon in the first continer with the Visible as per my last post, the Visible on the pop-up
    varShowContainer1
    and the OnSelect
    UpdateContext({varShowContainer1: true})
    then the X icon on the pop-up OnSelect
    UpdateContext({varShowContainer1: false})
    Regarding your question on different file types (two attachment controls), technically possible in View Mode but complex and problematic if you want to add/delete any.
     
    Please ✅ Does this answer your question 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 answering Yes to Was this reply helpful? or give it a Like ♥
    Visit my blog
    Practical Power Apps    LinkedIn  
  • Charlie Martharper Profile Picture
    943 Season of Giving Solutions 2025 on at
    Perfect @WarrenBelz!
     
    It works correctly as I wanted.
    I guess it gets all the attachments and I can't divide them into File types, because it gets just the attachments.
    I have 1 more question, if the part "es requereix preparació" is false, the "Documentació de preparació" and the icon shouldn't be visible:
    How can I make it? So only show that if there are attachments in the item in the list. There is a column type yes/no. It gets the info from there.
     
    Thanks for your time
  • Charlie Martharper Profile Picture
    943 Season of Giving Solutions 2025 on at
     
    Is it possible to open the files (attachments) in the browser? Is this a Sharepoint issue?
    Right now it downloads and it opens as the typedoc it is.
  • WarrenBelz Profile Picture
    155,838 Most Valuable Professional on at
    If you go back to my last post (I probably was a bit unclear), I noted that the Visible of that icon if you only wanted to show it if there were attachments present should be
    CountRows(
       LookUp(
          SPListName,
          ID = Gallery.Selected.ID
       ).Attachments
    ) > 0
    or if (as you have noted) the icon's value is either true or false, it is even easier - the Visible can be
    Self.Value
    For your last question, I have a blog outlining the process for this. You need a separate gallery with the Items
    LookUp(
       SPListName,
       ID = Gallery.Selected.ID
    ).Attachments
    and then a Text Label in the Gallery with
    ThisItem.DisplayName
    and OnSelect of the Gallery
    Launch(ThisItem.AbsoluteUri)
    As I noted, if you only want to view the attachments, you can have separate filtered galleries (as above) based on file extension instead of attachment controls. 
     
    Please ✅ Does this answer your question 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 answering Yes to Was this reply helpful? or give it a Like ♥
    Visit my blog
    Practical Power Apps    LinkedIn  

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 424

#2
WarrenBelz Profile Picture

WarrenBelz 355 Most Valuable Professional

#3
11manish Profile Picture

11manish 290

Last 30 days Overall leaderboard