cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Post Patron
Post Patron

Unable to add comment for Gallery item

Hi Power Apps Community,

Issue: I have a list of items in a Gallery. I would like to add a comment for each Gallery item. Before the comment is made, the details for the Gallery item is Patched the SharePoint

When you click on the 'Comment' icon, a pop-up appears - using UpdateContext, which has a Rich-text editor input. 

With the data already Patched to SharePoint, I assume that I would need to lookup the record in SharePoint, and the Patch the Update for the comment to the relevant line item.

Capture.JPG

I would really appreciate any assistance on this.

Thank you in advance.

2 ACCEPTED SOLUTIONS

Accepted Solutions
Super User III
Super User III

Hi @Data_Enthusiast ,

Assuming the gallery Items is based on the relevant SP list, you would do this after typing the comment (I assume you have a save button on the pop-up)

UpdateIf(
   YourSPListName,
   ID=YourGalleryName.Selected.ID
   {YourSPCommentField:YourPopupTextField.Text}
)

 

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.

View solution in original post

Post Patron
Post Patron

Hi everyone, in addition to the identified solution, I have also come up with another work-around.

I created another SharePoint list specifically for holding data around the comments. 

To ensure that a relationship is created between the comments list and the transaction list, I store the session id in both lists as well.

Hope this will also help out anyone facing a similar issue 🙂

View solution in original post

5 REPLIES 5
Super User III
Super User III

Hi @Data_Enthusiast ,

Assuming the gallery Items is based on the relevant SP list, you would do this after typing the comment (I assume you have a save button on the pop-up)

UpdateIf(
   YourSPListName,
   ID=YourGalleryName.Selected.ID
   {YourSPCommentField:YourPopupTextField.Text}
)

 

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.

View solution in original post

Hi @WarrenBelz 

Correct, I have a pop-up for the comment.

I tried the script provided, but was unsuccessful. The ID that is looked up in the Gallery is from another SharePoint list, and not the List where the data is Patched to.

The Gallery is referencing 'Master' list, whereas the list I am trying to Patch to is the 'Transaction' list.

Hi @WarrenBelz 

This worked, I actually referenced my Gallery wrong. Once I made the update and updated your script provided with the naming conventions that I have, the Update worked 🙂 

Post Patron
Post Patron

Hi everyone, in addition to the identified solution, I have also come up with another work-around.

I created another SharePoint list specifically for holding data around the comments. 

To ensure that a relationship is created between the comments list and the transaction list, I store the session id in both lists as well.

Hope this will also help out anyone facing a similar issue 🙂

View solution in original post

Hi @Data_Enthusiast ,

Yes if you have a many (comments) to one (record) relationship, that is exactly how you should handle it. I am not sure what you refer to with Session ID, but I generally use the ID number of the "master" record n a field (I name it IDRef - call it whatever you want) in the "child" list.

Helpful resources

Announcements
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

Top Solution Authors
Top Kudoed Authors
Users online (6,765)