Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

How to add date/timestamp to RichTextEditor field of SharePoint List column before each log entry

Posted on by 44

Hello,

I have attempted many different formulas for adding a date/timestamp with username or email of person who created the entry before each entry of a log column which uses a Rich Text Editor field.  I've tried many different syntax of Patch, UpdateContext, Date, DateAdd, etc.  Nothing works.  Can Rich Text Editor not have date/timestamp added?  I've viewed many YT videos and blog entries here in the community of how to do this, but have yet to be successful within my app.  Not using a basic text box or label.  Using a Rich Text Editor field.

 

How can I add a date/time stamp?  Below is my powerapps information:

 

Location - EditForm1>Log DataCard>RichTextEditor1. 

       RichTextEditor1: Default set to - ThisItem.'Log" - Log pulling data from SP list column

       Submit Button: OnSelect set to - (see below)

 

Patch("List", BrowseGallery1.Selected, {'Log': User().Email & ":" & Char(10) & Char(10) & Text(Now(), "[$-en-US]m/d/yy" & RichTextEditor1.HtmlText & Char(10) & Char(10) & BrowseGallery1.Selected.'Log'});

SubmitForm(EditForm1);

 

No errors occur when using this, however, it does not produce the desired results. 

 

What am I doing wrong?  Am I placing this in the wrong location? Instead of on the submit button, maybe somewhere else? Or should I use a different function?

 

Any help will be greatly appreciated. Thank you.

Categories:
  • Shannah_Bonner Profile Picture
    Shannah_Bonner 44 on at
    Re: How to add date/timestamp to RichTextEditor field of SharePoint List column before each log entry

    Yes, I removed the update from the Data Card. I believe I found the issue. Here is my previous code:

     

    Patch(source, BrowseGallery1.Selected, {'Log': Text(Now(), "[$-en-US]m/d/yy") & " - " User().Email & ":" & Char(10) & Char(10) & RichTextEditor1.HtmlText & Char(10) & Char(10) & BrowseGallery1.Selected.'Log'});

     

    I removed the 2nd set of Char(10) and BrowseGallery1.Selected.'Log' from the code.  Code now is:

     

    Patch(source, BrowseGallery1.Selected, {'Log': Text(Now(), "[$-en-US]m/d/yy") & " - " User().Email & ":" & Char(10) & Char(10) & RichTextEditor1.HtmlText & Char(10) & Char(10)

     

    My colleagues are stating it is still producing duplicates.  I will try removing everything after RichTextEditor1.HtmlText.  Hopefully this works.  

     

    Any ideas are appreciated.  Thank you.

     

  • WarrenBelz Profile Picture
    WarrenBelz 142,733 on at
    Re: How to add date/timestamp to RichTextEditor field of SharePoint List column before each log entry

    Hi @Shannah_Bonner ,

    I must admit that baffles me as well.  Have you removed the Update from the Data Card?

  • Shannah_Bonner Profile Picture
    Shannah_Bonner 44 on at
    Re: How to add date/timestamp to RichTextEditor field of SharePoint List column before each log entry

    Hi @WarrenBelz 

    Another problem has presented itself.  Now, the entries duplicate themselves each time an entry is made.  But this doesn't occur when I do it.  Only when another colleague makes an entry.  Could this be permission related?  Any help is greatly appreciated.  Thank you.

  • Shannah_Bonner Profile Picture
    Shannah_Bonner 44 on at
    Re: How to add date/timestamp to RichTextEditor field of SharePoint List column before each log entry

    This worked beautifully!!!  Thank you so much!  I'm just glad I had the formula right!  The only change I made, once I saw how the date and user email was added, was to rearrange the user email as first, then the date.  Accepting as solution.  Have a great weekend!

  • Verified answer
    WarrenBelz Profile Picture
    WarrenBelz 142,733 on at
    Re: How to add date/timestamp to RichTextEditor field of SharePoint List column before each log entry

    Hi @Shannah_Bonner ,

    The issue is that your SubmitForm immediately after the Patch will overwrite whatever you have patched with the content of the Rich Text box. Try putting the Patch on the OnSuccess of the Form and if you are always going to Patch this, remove the Update on the Data Card containing the Rich Text box.

     

    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.

    Visit my blog Practical Power Apps

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

October 2024 Newsletter…

October 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #4 How to Conntact Support…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 142,733

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,750

Leaderboard