cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
pedroperondini
New Member

Listing appended comments from SharePoint list in Power Apps

Hello!

 

So, i have a SharePoint list that is serving a HelpDesk application that i'm building on Power Apps, however, i have not been able to show the data on my "Comments" column on Power Apps. The list has the version setting enabled, and the Comments column also has the Append Changes enabled, however, my Help Desk app only displays the last comment made, not all of them.

How can i display all of the data in my Comments column in my app?

 

Many thanks!

2 ACCEPTED SOLUTIONS

Accepted Solutions
WarrenBelz
Super User
Super User

Hi @pedroperondini ,

I assume the users are typing into another text box that you want appended to the existing comments. You also have not said where the exiting comments are displayed - I assume they are on the screen somewhere in a text box. If so, `put this on whatever button saves the comments.

With(
   {wComments:YourExistingCommentsBox.Text},
   Patch(
      YourListName,
      {ID:YourCurrentItemID},
      {Comments:wComments & Char(10) & YourNewCommentsBox.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 @pedroperondini ,

My response was to your first post - you must have added the second one while I was posting.

For a simple "who did it and when", you can use the Modified and 'Modified by' fields which show the last user and time they used it. You can also turn on Versioning in SharePoint to keep track of all changes and who did them and when. Is this what you are meaning?

 

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

9 REPLIES 9
WarrenBelz
Super User
Super User

Hi @pedroperondini ,

I assume the users are typing into another text box that you want appended to the existing comments. You also have not said where the exiting comments are displayed - I assume they are on the screen somewhere in a text box. If so, `put this on whatever button saves the comments.

With(
   {wComments:YourExistingCommentsBox.Text},
   Patch(
      YourListName,
      {ID:YourCurrentItemID},
      {Comments:wComments & Char(10) & YourNewCommentsBox.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.

RezaDorrani
Dual Super User II
Dual Super User II

Hi @pedroperondini,

 

Here is a video walkthrough of achieving append comments

https://youtu.be/hzLEecSpmFo

--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

Thanks,
Reza Dorrani, MVP
YouTube
Twitter

Hi @WarrenBelz , thx for you reply! I'm sorry, i couldn't reply to you earlier... so, this is my patch function, it's in this green button "Enviar Comentários", the users type the comments in this text box over it, and the appended comments should be shown in another screen of my app. How should i implement your solution to my code?

 

Patch('Portal Único de Atendimento';ThisItem; {Comentários:ComentarioInput.Text});;

Office365Outlook.SendEmailV2(ThisItem.Solicitante.Email; "[Portal Único de Atendimento] - Há um novo comentário no seu chamado"; "Olá, o seu chamado possui um novo comentário!<br> Acesse o <a href=https://apps.powerapps.com/play/linkurlpowerapps;source=portal&amp;screenColor=rgba(0%2C%20176%2C%20240%2C%201)>Portal Único de Atendimento</a> para visualiza-lo.");;

Navigate(Sucesso_Comentário;ScreenTransition.Fade);;

 

 Screenshot_5.png

Hi @RezaDorrani , thank you for your reply and i'm sorry for taking so much time to reply back. So, your solution isn't viable for me, for some business reasons, i need to avoid using HTML / Rich Text fields, only plain texts, but i'm thankful anyways!

Warren, just to give you an update, i managed to add your code to my application, and it worked as intended! Is there a way to show who and when the comment was made?

 

Many thanks for all the help!

Hi @pedroperondini ,

You still need to get your existing comments from somewhere to add the text box contents to them. There are several ways of doing this, but assuming that the Form you have your text box in is based on the same list as you want the new comments to be added to. If this is the case, this would probably work

With(
   {
      wComent:
      LookUp(
         'Portal Único de Atendimento';
         ID=ThisItem.ID
      ).Comentários
   };
   Patch(
      'Portal Único de Atendimento';
       ThisItem; 
      {Comentários:wComent & Char(10) & ComentarioInput.Text
   }
);;

You could also put the current comment field in your form and hide it (I will name the text box txtComent below) and then simply do this

Patch(
   'Portal Único de Atendimento';
    ThisItem; 
    {Comentários:txtComent.Text & Char(10) & ComentarioInput.Text
   }
);;

Whatever way you do it, you need to retrieve the current value of the field and add the new input to it.

 

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.

Hi @WarrenBelz , sorry i don't think i understood this part, i'm pretty new to Power Apps... How this function allows me to show what user commented and when,? I tried it here, and the output keeps the same... And yes, it's a single list that keeps all the data for the Help Desk, appended comments included!

Hi @pedroperondini ,

My response was to your first post - you must have added the second one while I was posting.

For a simple "who did it and when", you can use the Modified and 'Modified by' fields which show the last user and time they used it. You can also turn on Versioning in SharePoint to keep track of all changes and who did them and when. Is this what you are meaning?

 

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.

 

Hi, I have used @RezaDorrani 's solution on a plain text field, instead of inserting a richtextfield control, just insert a textinput instead for the user input area. For the second field (where it gets its data from) instead of using the fieldname.htmltext use fieldname.text. And finally as it's a text field the linebreak char doesn't work so use "<br>" instead and all is well

 

Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (1,531)