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 / Filter Comment Gallery...
Power Apps
Answered

Filter Comment Gallery by Current Project

(0) ShareShare
ReportReport
Posted on by

Hello,

 

I was wondering if someone could help guide me through how to filter my Comments Gallery by the selected project as my Comments gallery currently shows all Comments. My "Parent" list is a SharePoint list called 'Tool Design Support Requests'. My "Child" list is a SharePoint list called 'Tool Request Comments'. I can't figure out how to tie the two together. I created a LookUp column in the Comments SharePoint List that looks up to the TDSR SharePoint List attempting to tie them together with the Request Summary Title, but as you can see in the attached screenshot, the LookUp columns aren't populating. I'm happy to tie them together by SharePoint ID as well, but I don't know how to do that either. I've watched several tutorials, but none of them match my use case (e.g. they are done in Excel or have other key differences) so as someone new to Power Apps, the concept isn't clicking yet.

 

The only thing I have in my Items property for the Comments so far is Sort('Tool Request Comments',Modified,Descending). I've attached a screenshot of the gallery and form users use to add new comments to it. I'm 90% of the way there, I just need this all important piece.

 

Thank you!

Teresa

TRC-List-ParentID.png
Comments-Gallery-SS.png
Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    154,471 Most Valuable Professional on at

    Hi @tagustin2020 ,

    You simply need a "common key" and probably the easiest (which I use) is having the ID number of the parent 'Tool Design Support Requests' in a field in 'Tool Request Comments'. I see you have a field 'Parent ID' in the list, but it is empty. If you had the number in there and (for instance) had the ID of the main form in a hidden field called txtID, your gallery Filter would be

    Filter(
     'Tool Request Comments',
     'Parent ID' = Value(txtID.Text)
    )

    Is this what you are asking and I am not entirely clear?

     

    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.

     

  • tagustin2020 Profile Picture
    on at

    Hello Warren, 

     

    Thank you for responding to my question. I know you are somewhat familiar with my app at this point since you have helped me with a few other items, but I'll recap here for anyone else who might read the post.

     

    My app has a home screen gallery, a new request form screen and an edit screen with four tabs. The gallery and all of the forms except for the the New Comment form and display gallery have 'Tool Design Support Requests' as the data source. I set up a variable on the nav arrow in the gallery so the app knows which record to pull up for each of the Edit forms (Request, Designer and Model Shop). Where I am stuck is how to have the Comment form know which record I wish to add a comment to so that the information displays correctly in the Comment gallery. I created a column in the Request Comments SharePoint List to capture a key to the 'Tool Design Support Requests' SharePoint list, but I don't know how to actually establish the connection. Can you help me understand that piece of it? Is there either a visible or hidden field I need to put in the Comments form to hook it up to the record they are trying to establish a connection to? That's where I get lost.

     

    Thank you,

    Teresa

  • Verified answer
    WarrenBelz Profile Picture
    154,471 Most Valuable Professional on at

    Thanks @tagustin2020 ,

    I will still go with my original post concept - hide a card on the comment add/edit/view form (you did not show me this one) for the Field 'Parent ID' - I will refer to the form as frmComments below - change to your name.
    When you select an item to display in any of the tabs, add this to the Gallery OnSelect.

    Set(varID,Self.Selected.ID)

    In the Default of the hidden 'Parent ID' Text Control on the Comments Form when you add or view/edit the comment.

    If(
     frmComments.Mode=FormMode.New,
     varID,
     Parent.Default
    )

    Then the Items of your Comments gallery

    Sort(
     Filter(
     'Tool Request Comments',
     'Parent ID'=varID
     ),
     Modified,
     Descending
    )

     

    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.

  • tagustin2020 Profile Picture
    on at

    Hi Warren,

     

    Thanks for the advice. Unfortunately, I can't quite get it working yet. I've attached detailed notes and screenshots of what I tried in connection to your latest post. 

     

    Kind regards,

    Teresa

  • WarrenBelz Profile Picture
    154,471 Most Valuable Professional on at

    Hi @tagustin2020 ,

    I do not have a lot of time at the moment, but you can set varID to varRecord.ID immediately after you set varRecord.

    I will look at the rest a little later on.

  • tagustin2020 Profile Picture
    on at

    Thank you so much Warren. That last step made everything fall into place. Just one more question. I am getting a delegation warning for my Gallery Items property formula, under the = sign (see screenshot). Do you know how I could rephrase the formula so this is not an issue? I expect we will have a lot of Comments so I don't want to run into display issues down the road. As you can see below, my goal is to have the most recent comments shown at the top of the gallery.

     

    Sort(Filter('Tool Request Comments',ParentID=varRecord.ID),Modified,Descending)

     

    Thanks again. I've been trying for so long to get this going without success, that I am very grateful for your help.

    Teresa

    FormulaDelegationWarningSS.png
  • WarrenBelz Profile Picture
    154,471 Most Valuable Professional on at

    Hi @tagustin2020 ,

    I am assuming ParentID is a Numeric field in the list? This is quite strange. For a test, try this

    With(
     {wID,varRecord.ID},
     Sort(
     Filter(
     'Tool Request Comments',
     ParentID=wID
     ),
     Modified,
     Descending
     )
    )

     

    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.

  • tagustin2020 Profile Picture
    on at

    Hi Warren,

     

    The ParentID column is a single line of text field. The formula below is fully underlined in red when I copy paste it into the Items property of the Comments gallery and it is a no-go if I try to manually type it in. Intellisense won't even surface the name of the SharePoint List. I think PowerApps might be confused by wID. Is that a variable I need to set somewhere before proceeding to this step?

     

    Teresa

  • WarrenBelz Profile Picture
    154,471 Most Valuable Professional on at

    Hi @tagustin2020 ,

    This issue is the mismatch - two options

    1. Change the ParentID to Numeric (preferred) and the formula will work
    2. Use the below
    With(
     {wID,Text(varRecord.ID)},
     Sort(
     Filter(
     'Tool Request Comments',
     ParentID=wID
     ),
     Modified,
     Descending
     )
    )​

    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.

  • tagustin2020 Profile Picture
    on at

    Hello Warren,

     

    I went back to my data source and changed the ParentID column type from single line of text to number so thank you for that tip. If I could ask you just one more Comments related question, it is this.  My Author Role drop down is based on a Choice Column in my SharePoint list. Power Apps defaults the dropdown control Items property to Choices([@'Tool Request Comments'].AuthorRole. the Data Type is table. Every morning when I open the app to work on it, it throws an error - "The data source supplied to the function is invalid." If I change the formula to Choices('Tool Request Comments'.'Author Role'), the error message goes away, but the next day when I log back in, the previous default formula has been restored and the error message reemerges.

     

    Currently, the Default property for the dropdown is blank and the DefaultSelectedItems property formula is:

    LookUp(Choices('Tool Request Comments'.'Author Role'),Value="-Select One-")

     

    Is there something I can do to stop this error from surfacing everyday? The dropdown seems to function despite the error message, but it is annoying...

     

    Thanks,

    Teresa

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!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 542 Most Valuable Professional

#2
Haque Profile Picture

Haque 206

#3
Kalathiya Profile Picture

Kalathiya 201 Super User 2026 Season 1

Last 30 days Overall leaderboard