cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Alderney
Helper III
Helper III

Patch rich text editor to Sharepoint to add to existing text

Hi

I have an app connected to a Sharepoint contacts list.  I am wanting to add to the notes section in this list, which already has information in some cases.  I have made that column (notes (comments) ) an enhanced rich text column.

In my app I have a gallery with populated information from the sharepoint contacts list.  I have an HTML text box to show the information already in the notes(comments) column.  I added a rich text editor into the gallery, so information can be added to this column.

The first image shows the screen set up

The second image shows the patch formula I used first.  This works, however, it just changes the information not add to it. 

the third image I tried @shane Young's videos showing this formula, however, I had no joy with that either. just tells me requires title and then when I add it doesn't recognise it.

powerapps richtext editor patch issue.png

 

Can anyone direct me as to where i'm going wrong

 

1 ACCEPTED SOLUTION

Accepted Solutions
EddieE
Super User
Super User

@Alderney 

To show them in reverse order just reverse the way they are Patched, ie

Patch(
   'NZ Schools Contacts', 
   {ID: Gallery1.Selected.ID},
   {
      Title: ThisItem.'Full Name'}, 
     {'Notes (Comments)': $"{RichTextEditor1.HtmlText}  {ThisItem.'Notes (Comments)'}"
   }
)

 

To clear the RichText Editor, if you set its Default property to "" then use Reset(RichTextEditor1) this will work.

View solution in original post

6 REPLIES 6
EddieE
Super User
Super User

@Alderney 

For the notes column you should be able to just add this

Patch(
   ...
   { ...
     'Notes (Comments)': $"{ThisItem.'Notes (Comments)'}   RichTextEditor1.HtmlText"
   }
// I haven't added all of your code but hopefully this makes sense?
// You can add anything extra you want inside of the "" above but if you are using data point place them inside of {...} like I've done above

 

 

@EddieEthanks for your help!

I tried your coding, and it works, however, it just puts in the last part ie RichTextEditor.HtmlText, and it put it below.

Here is my code


 

Patch(
   'NZ Schools Contacts', 
   {ID: Gallery1.Selected.ID},
   {
      Title: ThisItem.'Full Name'}, 
     {'Notes (Comments)': $"{ThisItem.'Notes (Comments)'}  RichTextEditor1.HtmlText"
   }
)

​

 

Result on test screen

powerapps richtext patch issue2.png

@Alderney 

Whoops, my bad, should've been this

Patch(
   'NZ Schools Contacts', 
   {ID: Gallery1.Selected.ID},
   {
      Title: ThisItem.'Full Name'}, 
     {'Notes (Comments)': $"{ThisItem.'Notes (Comments)'}  {RichTextEditor1.HtmlText}"
   }
)

​

 

 

@EddieE 

Great Thanks Eddie, It's working, is there a way of doing it so it goes on the top of existing information not the bottom? Any ideas how to reset the editor, adding Reset(RichTextEditor1) doesn't work after the last )

EddieE
Super User
Super User

@Alderney 

To show them in reverse order just reverse the way they are Patched, ie

Patch(
   'NZ Schools Contacts', 
   {ID: Gallery1.Selected.ID},
   {
      Title: ThisItem.'Full Name'}, 
     {'Notes (Comments)': $"{RichTextEditor1.HtmlText}  {ThisItem.'Notes (Comments)'}"
   }
)

 

To clear the RichText Editor, if you set its Default property to "" then use Reset(RichTextEditor1) this will work.

@EddieE  Thanks so much!

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,160)