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

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. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

8 REPLIES 8
RandyHayes
Super User III
Super User III

@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. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

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. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

@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. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

@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. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Top Kudoed Authors
Users online (55,900)