cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sudosaurus
Post Partisan
Post Partisan

Add en-GB to Now() RichTextComments field

Hello,

 

I have setup commenting in my PowerApps form where the Default value of my DataCard is equal to:

If(Not(IsBlank(RichTextComments.HtmlText)),User().FullName & " " & Now() & RichTextComments.HtmlText & Char(13)) & ThisItem.Comments

Id like to ensure that when the my name and date/time is appended to this it displays correctly in the SharePoint Canvas App form.

 

Currently in PowerApps it displays correctly as: Chris Cundy 23/09/2020 13:58 however in SharePoint is displays as: Chris Cundy 9/23/2020 2:01 PM - it is showing the date format incorrectly and yes the Regional settings for my site are correct.

Somehow I need to add en-GB dd-mm-yyyy format into the above code - any ideas?? 🙂

1 ACCEPTED SOLUTION

Accepted Solutions

@sudosaurus 

Ooops...on high-speed here with things.  There was an extra paren.

If(!IsBlank(RichTextComments.HtmlText),
   User().FullName & " " & 
   Text(Now(), "dd/mm/yyyy") & 
   RichTextComments.HtmlText & "<br>",
   ""
) &
ThisItem.Comments
_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

8 REPLIES 8
RandyHayes
Super User
Super User

@sudosaurus 

You can format Now() in any way you want.  Consider the following:

If(!IsBlank(RichTextComments.HtmlText),
   User().FullName & " " & 
   Text(Now(), "dd/mm/yyyy") & 
   RichTextComments.HtmlText & "<br>") & 
   ThisItem.Comments
)

 

Also note that you are working with Html, so the <br> rather than Char(13) for the line break.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Hi @RandyHayes ,

 

This doesn't appear to work. It breaks the comments function.

@sudosaurus 

Can you provide an error you are seeing, or a screenshot?

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

@RandyHayes this is what I'm receiving back.

error.png

@sudosaurus 

Give this a try:

If(!IsBlank(RichTextComments.HtmlText),
   User().FullName & " " & 
   Text(Now(), "dd/mm/yyyy") & 
   RichTextComments.HtmlText & "<br>",
   "") 
) &
ThisItem.Comments

Sorry, I had the logic a bit off. 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

@RandyHayes still not working correctly

 

error1.png

@sudosaurus 

Ooops...on high-speed here with things.  There was an extra paren.

If(!IsBlank(RichTextComments.HtmlText),
   User().FullName & " " & 
   Text(Now(), "dd/mm/yyyy") & 
   RichTextComments.HtmlText & "<br>",
   ""
) &
ThisItem.Comments
_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

@RandyHayes TOP MAN! That worked!!

 

If(!IsBlank(RichTextComments.HtmlText), User().FullName & " " & Text(Now(), "dd/mm/yyyy hh:mm:ss") & RichTextComments.HtmlText & "<br>", "" ) & ThisItem.Comments

 

Thank you 🙂

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,524)