web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Comment History - Time...
Power Apps
Unanswered

Comment History - Time & Date Stamp Upon Submission

(0) ShareShare
ReportReport
Posted on by 40

I have a Power App that has a comment log. Whenever a new comment is added it will capture ***, the user, the date and time, and status, which is mapped to a dropdown field. The *** is how I'm telling the gallery to split up the comments. However, upon the first submission of a new form the comment log will not update with  ***, the user, the date and time, status, and status dropdown. 

rachelsweet123_0-1663947674291.png

 

Categories:
I have the same question (0)
  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @rachelsweet123 

    Never mind the question in your other post...I see your format now!

     

    So first off...one of the things I am noticing in your formula is that you have a Form!  If this is the form, then you should be using the SubmitForm function - not Patch to submit your data.

     

    Can you clarify that, and if so, why Patch over submit form?

  • rachelsweet123 Profile Picture
    40 on at

    Lol I posted how the actual comment log looks on the other post, but I'm using the patch function instead of the submit form because I'm setting up the header for the comments with ***, username, date/time, and status.

     

    Comments: varRecord1.Comments & "***" & User().FullName & " || " & DateTimeValue(Now()) & " || " & "Status" & " : " & Dropdown1.Selected.Value & RichTextEditor3.HtmlText

  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @rachelsweet123 

    Skip the Patch function!!  You want to submit your form with SubmitForm.  I notice actually that you are doing both in your formula...this will not be good!

     

    Everything you are trying can all be done in the form.

    What is the Update property of your Comments field datacard?

     

    But, I need to understand more about how you are displaying the comments.  From your other post, it looks like you have them in a Gallery??  Can you describe more about how you are displaying your comments?

     

    (taking food break...back soon to reply to your reply)

     

  • rachelsweet123 Profile Picture
    40 on at

    Yeah I knew having both was wrong. At this point I was trying everything 😞 

     

    So the Comments field should be updating the enhanced rich text Comment column on sharepoint. 

     

    rachelsweet123_1-1663949567503.png

    The comments look like this on sharepoint. Like I said I use the *** to split the comments in the gallary.

    rachelsweet123_2-1663949754895.png

     

    Here is the Comment field.

    rachelsweet123_0-1663949462087.png

    Please don't judge if I did this all the wrong way....I'm a self-taught noob. 

     

    This is the way the gallery is displayed with this formula on items:

    Filter(Split(varRecord1.Comments, "***"), !IsBlank(Result))

     

    Within the Gallery is HTMLText with ThisItem.Result

    rachelsweet123_0-1663950983887.png

     

  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @rachelsweet123 

    All good.  No worries on the method.  There are a few things to consider.

     

    First - before some of the suggestions.  You are delimiting your items in your comments with ***, || and :

    This means you need to be cautious of the html you are putting in from the comments.  Meaning...In the event that someone happens to enter *** in the comments or ||, this will completely throw your formulas off!!

    Just want to make this clear.  There are ways to solve that, but, want to make sure you are prepared for that.

     

    Next observation - varRecord1 - is that the Item property of your form??

     

    Now, as far as your Items property for the gallery...This IS a great place for the ForAll function - which is a function that produces a Table (not a For Loop!)

    So, changing your formula to:

    Sort(
     ForAll(
     Filter(Split(varRecord1.Comments, "***"), !IsBlank(Result)),
     With({_rec: Split(Result, "||")},
     {User: Index(_rec, 1).Result,
     CommentDate: DateTimeValue(Index(_rec, 2).Result),
     Status: Last(Split(Index(_rec, 3).Result, ":")).Result,
     Comment: Index(_rec, 4).Result
     }
     )
     ),
     CommentDate
    )

    This now provides a valid record with a typed schema for your gallery.  NOTE: This also sorts - which answers your other post.

     

    Things like your User label would have a text property of: ThisItem.User etc.

    Your HtmlText control would have a HtmlText property of: ThisItem.Comment

     

    Now...tell me how you are adding comments.  What is your strategy for that?

     

  • rachelsweet123 Profile Picture
    40 on at

    So the item property should probably be varRecord1 because on my other screen the gallery the next icon sets that item as the varRecord1

    rachelsweet123_0-1663959535520.png

    rachelsweet123_1-1663959751778.png

     

     

     

  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @rachelsweet123 

    Yes, your Item property should be varRecord1 in this case.

  • rachelsweet123 Profile Picture
    40 on at

    So this is the full end to end of my powerapp 

    Homepage: 

    rachelsweet123_2-1663959991615.png

    The new request log button takes them to an edit form. The gallery has little arrows that if selected will open up the comment log gallery. Please note the first comment box does not have the same highlighted header in red. This is my issue. When a user selected "New Request Log" it opens to a form with a comment box that isn't capturing the header. However, if the user selects the "Add Comment" button a pop-up comes up for the user to select a new status from a drop down and add a comment. The submit button on the pop-up patches the comment box field with the header.

    rachelsweet123_3-1663960209426.png

     

  • rachelsweet123 Profile Picture
    40 on at

    rachelsweet123_4-1663960636644.png

    Error I get with the suggested formula to sort the comments.

  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @rachelsweet123 

    What is your Gallery Items property at this point (just to be clear)?

    Also, you are stating that the gallery is not showing the header.  I assume you mean on the first row in your gallery?

    Next - For that particular record comments you are showing in the gallery in your photo, can you provide the text string that is in the Comments column for that record (you can chop out any comment part if needed, but leave your delimiters intact)

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard