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 / Creating a locked comm...
Power Apps
Answered

Creating a locked comment section with date and time stamps

(0) ShareShare
ReportReport
Posted on by 10

I am trying to create a comment section where users can submit update comments. Once entered, it would show their name as well as a date and time stamp next to their comments (Ex. John Smith - I have submitted the permit. 1/31/2023 10:09 AM). I would also like for the previous comments to be "locked" so that they cannot be deleted by users. 

 

I believe I am getting close to a solution but am having some trouble. 

 

"<span style='font-size:10pt'>"& Now() &"</span> " & " - " & DataCardValue18.HtmlText & Char(13) & EngineerScreenGallery.Selected.Comments & Char(10) & Char(10) & Char(10)

 

 Here is the formula I am currently using. Below is an image of what I am seeing in my comment section.

FutbalFan7_0-1675178407617.png

Any direction would be appreciated!

 

Categories:
I have the same question (0)
  • Adrian_Celis Profile Picture
    1,652 Moderator on at

    Hi @FutbalFan7 

    When I create a comment section in PowerApps I usually use a separate SharePoint list for all the comments (with one item per comment) and then display it in a gallery. Since I see that you are using a rich text field, you can use that rich text field for only the user input, and then when showing the rest of the comments, you can use an HTML control to see all the styling. Please see image below for a sample:

    Adrian_Celis_0-1675263381497.png

     

  • FutbalFan7 Profile Picture
    10 on at

    Hey @Adrian_Celis,

     

    I was able to split it into two text inputs. So I have a data card that includes a 'Comments History' text input and a 'Comment/Update' text input. I type my comments in the 'Comment/Update' text input and they show up in the 'Comments History' text input. Works great.

    FutbalFan7_2-1675370189833.png

    Below is the formula I have in the Default property of my Data Card.

    ThisItem.Comments & 
    If(
     EngineerEditForm.Mode = FormMode.Edit && Len('TextInput4'.Text) > 0,
     Char(10) & Char(10) & User().FullName & " - " & 
     Text(
     Now(),
     "mm/dd/yyyy hh:mm:ss"
     ) & 
     " - " & 'TextInput4'.Text
    )

    My issue is, and you can see it highlighted in the first image, I am getting a bunch of random texts/digits at the beginning and the middle of my display. Any idea how I can clean this up?

    FutbalFan7_1-1675369990895.png

    The 'Comments History' text input default is the Parent. I do have these comments shown on a gallery screen if that is a potential problem area. I am not sure where this random text is coming from.

  • Verified answer
    Adrian_Celis Profile Picture
    1,652 Moderator on at

    Hi @FutbalFan7 

    There are HTML code in your comments somehow. Either clean up your input or use PlainText function. Can you try enclosing your code with PlainText

    PlainText(
    ThisItem.Comments & 
    If(
     EngineerEditForm.Mode = FormMode.Edit && Len('TextInput4'.Text) > 0,
     Char(10) & Char(10) & User().FullName & " - " & 
     Text(
     Now(),
     "mm/dd/yyyy hh:mm:ss"
     ) & 
     " - " & 'TextInput4'.Text
    )
    )
  • FutbalFan7 Profile Picture
    10 on at

    On my SharePoint list I was able to uncheck 'allow rich text' after you pointed that out. Thank you.

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

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 329 Most Valuable Professional

#2
11manish Profile Picture

11manish 209 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 179

Last 30 days Overall leaderboard