Create your OWN Appending Comments in PowerApps

Andrew Hess - MySPQuestions
Andrew Hess - MySPQuestions
12.9 هزار بار بازدید - 2 سال پیش - Want to have a comments
Want to have a comments section in your Power App and also keep all the old comments plus the user name? This was a requirement in one of my projects.

We use a SharePoint multi-line text field to store the comment data. We even add our own HTML to bolden our name an italic the comments.

My name is Andrew Hess and this is a Power Apps tutorial.


New Comment, on One Screen:
Patch(
       MyComments,
       {
           Title: TextInput2.Text,
           theComments: Now() & " - " & "&ltb&gt" & User().FullName & "&lt/b&gt" & " " & "&lti&gt" & RichTextEditor1.HtmlText & "&lt/i&gt"
       }


Patch Comment, on One Screen:
Patch(
       MyComments,
       Gallery1.Selected,
       {theComments: Now() & " - " & "&ltb&gt" & User().FullName & "&lt/b&gt" & " " & "&lti&gt" & RichTextEditor1.HtmlText & "&lt/i&gt" & HtmlText1.HtmlText}
   )

When using 2 screens, you can define a variable to tell the screen whether you are in Edit Mode or in New Mode.

Combined Patch Comments Button on both Screens:
If(
   varNewForm,
   Patch(
       MyComments,
       {
           Title: TextInput2.Text,
           theComments: Now() & " - " & "&ltb&gt" & User().FullName & "&lt/b&gt" & " " & "&lti&gt" & RichTextEditor1.HtmlText & "&lt/i&gt"
       }
   );Navigate(Screen1,Fade);,
   Patch(
       MyComments,
       Gallery1.Selected,
       {theComments: Now() & " - " & "&ltb&gt" & User().FullName & "&lt/b&gt" & " " & "&lti&gt" & RichTextEditor1.HtmlText & "&lt/i&gt" & HtmlText1.HtmlText}
   )
);


Chapters:
0:00 Introduction
1:19 SharePoint with Comments
2:57 Starting our Power App
4:35 Writing the Patch Statement
7:32 Writing our own HTML in our Comment
10:55 Writing a new comment using 1 Screen
13:44 Adding a Second Screen to our Power App
15:53 If A New Form Then "Do This"
18:00 Using Patch for our 2 Screen Comments
20:10 Making Title and Comments Required
2 سال پیش در تاریخ 1401/10/13 منتشر شده است.
12,983 بـار بازدید شده
... بیشتر