cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Comments History

Hi All,

 

I have a requirement where in I am using Multiline Text Column with Append changes. My data source is sharepoint. 
in my PowerApps, I want to show the history of comments that has been added into the column. 
How can I achieve this?

1 ACCEPTED SOLUTION

Accepted Solutions
mdevaney
Super User
Super User

@Anonymous 
Suppose you want to leave a comments history that looks like this:

 

 

MDEVANEY - 10/12/2020 8:00 AM - I like this list item

 

MDEVANEY - 10/12/2020 9:30 AM  - Very interesting find

MDEVANEY - 10/12/2020 10:00 AM - Is this right?

 

 

To do this create a multi-line text column in SharePoint called 'Comments'.  Then add an Edit Form that includes the comments field.  Add a 2nd text input field to the Comments card called TextInput_NewComments.Text.  This is where you will type new comments.

 

Next, replace the Default property of the comments Text Input Card with this code.  When you type in a new comment it will be added to the previous comments.

 

If(
    Form1.FormMode=FormMode.Edit,
    ThisItem.Comments & User().FullName & " - " & Now() & " - " & TextInput_Comments.Text & Char(10) & Char(10),
    ThisItem.Comments
)

 

Write your newly typed comment into the form and submit it using this code in the OnSelect property of a button

SubmitForm(Form1)

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

10 REPLIES 10
rsaikrishna
Community Champion
Community Champion

@Anonymous 

 

I do not recommend using Multiline Text field with Append Changes as there is no way to show Append Changes (OR) History comments in the Power Apps.

 

Reference: https://powerusers.microsoft.com/t5/Building-Power-Apps/Listing-Appended-Changes-from-Sharepoint-List-on-PowerApps/td-p/44938

 

Workaround:

Create two SharePoint fields - One field is Single line of Text for Comments (CommentsField) , second one is Multi line of Text field without Append changes (CommentsHistory).

 

In the Power Apps, show CommentsField as editable field to the user and CommentsHistory as Read Only field in View Mode of the item.

 

In the CommentsHistory update property, you can set the value as tbCommentsField.Text & ThisItem.CommentsHistory. 

 

 

With this, you can append your comments to the History. 

 

Regards

Krishna Rachakonda

If this reply helped you to solve the issue, please mark the post as Accepted SolutionMarking this post as Accepted Solution, will help many other users to use this post to solve same or similar issue without re-posting the issue in the group. Saves a lot of time for everyone.
JayMagness
Solution Specialist
Solution Specialist

Hi,

 

I ran into this before and actually did something to make it even better

 

Created a SharePoint List called Blah, Blah, Notes...

 

Then linked the record ID for the main thing you are commenting or taking notes on.

 

Then added a form and a gallery to the screen.

 

Then just link it all up.

 

I also added User, Locations, Weather, etc.. to capture who, what when where of comments.

 

 

mdevaney
Super User
Super User

@Anonymous 
Suppose you want to leave a comments history that looks like this:

 

 

MDEVANEY - 10/12/2020 8:00 AM - I like this list item

 

MDEVANEY - 10/12/2020 9:30 AM  - Very interesting find

MDEVANEY - 10/12/2020 10:00 AM - Is this right?

 

 

To do this create a multi-line text column in SharePoint called 'Comments'.  Then add an Edit Form that includes the comments field.  Add a 2nd text input field to the Comments card called TextInput_NewComments.Text.  This is where you will type new comments.

 

Next, replace the Default property of the comments Text Input Card with this code.  When you type in a new comment it will be added to the previous comments.

 

If(
    Form1.FormMode=FormMode.Edit,
    ThisItem.Comments & User().FullName & " - " & Now() & " - " & TextInput_Comments.Text & Char(10) & Char(10),
    ThisItem.Comments
)

 

Write your newly typed comment into the form and submit it using this code in the OnSelect property of a button

SubmitForm(Form1)

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Anonymous
Not applicable

@mdevaney i tired your solution and it worked good. However, how do i make the last appended text as the first one in the comment box.

 

@mdevaney  I wonder if you can help me get your formula in to mine, below is what I have for my comments.

 

Comments1.JPG

I wanted to post even though one asked about this 8 months ago, but would rather share with the community for when others come to this post they can know the resolution too.  With help from my teammate Divya the solution to make the last appended text as the first on in the comment box is quite simple.  Here is the following adjustment to @mdevaney function:

If(
    Form1.FormMode=FormMode.Edit,
    User().FullName & " - " & Now() & " - " & TextInput_Comments.Text & Char(10) & Char(10) & 
    ThisItem.Comments,
    ThisItem.Comments
)

 

DataCardValue63.Selected.Value &"-"& varDate &Char(10)&Char(10)&  DataCardValue63.Selected.Value &"-"& varDate

comment box : showing same repeated but not showing last changed value

 

 Not started-10/112021
Not started-10/112021 

@Ungarala1 just spotted this.  Not sure if you have solved your possible issue or if you was posing a question for help with the function you provided or not.  If you was from what I see is you don't have a second control listed where you are writing it too.  If you look at what Matt Devaney provided:

 

If(
    Form1.FormMode=FormMode.Edit,
    ThisItem.Comments & User().FullName & " - " & Now() & " - " & TextInput_Comments.Text & Char(10) & Char(10),
    ThisItem.Comments
)

You will see he has twice ThisItem.Comments but the other Card/Control is TextInput_Comments.Text.  

 

Let us know if was able to resolve if this was a question or an issue.  Thank you

J84
Regular Visitor

Hi there, 

I didn't understand if you want to extract the historical comments from share point or to append the multiple comments in single comments field. If the it's the later case i.e. append the multiple comments in single comments field then you can try to implement it by using a Patch Function using Rich text Editor and a Html text box. I have followed the steps mentioned in the Youtube link below:

@ Running List of Comments using Power Apps and SharePoint - YouTube.

This guy explains his steps in a clear way. Check this video and hope it solves your query 🙂 

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Top Solution Authors
Top Kudoed Authors
Users online (2,853)