cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Privat2020
Helper I
Helper I

Rich Text comment

Hi Community,

I have a rich text box comment in my powerapps and i want if i write a comment then click on save button, then it will patch that comment in my sharepoint list, i have a column called "comment" in my sharepoint.

comment.JPG

Thanks.

2 ACCEPTED SOLUTIONS

Accepted Solutions
phipps0218
Super User
Super User

Is this part of a form component or is it just on its own? If form then use Submit Form function, if its own component then use the Patch function. Something like:

 

Patch(
 DATASOURCE,
 Defaults(DATASOURCE),
 { 
  Title: "ABC",
  comment: RichTextEditor1.HtmlText
 }
)

 

Please Accept as Solution if it solves your question. Or just give it a Thumbs Up if it is helpful because this can help others.

LinkedIn: https://www.linkedin.com/in/charlie-phipps-%F0%9F%91%A8%E2%80%8D%F0%9F%92%BB-91338715b/
YouTube: https://www.youtube.com/channel/UChmFBGU1YKIU91sNMQ7buGg
Twitter: https://twitter.com/phipps0218

View solution in original post

I see yes of course, it creates a new line. But no problem. I thought you want it that way.

 

If you want to update with a comment, the Example text wuld be like this 

Patch(
 DATASOURCE,
 LookUp(DATASOURCE, SEARCHCRITERIA),
 { 
  comment: RichTextEditor1.HtmlText
 }
)

 That means if you want to update it absed on the title

Patch(
 DATASOURCE,
 First(LookUp(DATASOURCE, Title = "ABC")),
 { 
  comment: RichTextEditor1.HtmlText
 }
)

 You could also always Update the First record with 

First(DATASOURCE)

 

But that doesnt make much sense. (IT also has a really high delay)

 

I suggest you, to work with IDs or Title. You need at least a unique identifier.

 

To explain the Patch to you basically. 
You need the Datasource, the record you want to modify and than what you want to modify.

 

Hope I could help you.  

 

View solution in original post

4 REPLIES 4
phipps0218
Super User
Super User

Is this part of a form component or is it just on its own? If form then use Submit Form function, if its own component then use the Patch function. Something like:

 

Patch(
 DATASOURCE,
 Defaults(DATASOURCE),
 { 
  Title: "ABC",
  comment: RichTextEditor1.HtmlText
 }
)

 

Please Accept as Solution if it solves your question. Or just give it a Thumbs Up if it is helpful because this can help others.

LinkedIn: https://www.linkedin.com/in/charlie-phipps-%F0%9F%91%A8%E2%80%8D%F0%9F%92%BB-91338715b/
YouTube: https://www.youtube.com/channel/UChmFBGU1YKIU91sNMQ7buGg
Twitter: https://twitter.com/phipps0218

RiccoHipp1903
Resolver II
Resolver II

It ssems like a custom HTml text for that it would be 

Patch(
 DATASOURCE,
 Defaults(DATASOURCE),
 { 
  Title: "ABC",
  comment: RichTextEditor1.HtmlText
 }
)

Hi @RiccoHipp1903 

Thanks for the feedback, the code works well but it create a new row each time i make a comment!

as you can see, my sharepoint list looks like that, and i want if i make any comment then the comment will be written in the first row (see where i make a comment). Thanks.

Patch(
 DATASOURCE,
 Defaults(DATASOURCE),
 { 
  comment: RichTextEditor1.HtmlText
 }
)

I deleted Title in the code because i do not want to create any other title 

Name

comment

XXX

Comment should be written here!

XXX

 

XXX

 

XXX

 

I see yes of course, it creates a new line. But no problem. I thought you want it that way.

 

If you want to update with a comment, the Example text wuld be like this 

Patch(
 DATASOURCE,
 LookUp(DATASOURCE, SEARCHCRITERIA),
 { 
  comment: RichTextEditor1.HtmlText
 }
)

 That means if you want to update it absed on the title

Patch(
 DATASOURCE,
 First(LookUp(DATASOURCE, Title = "ABC")),
 { 
  comment: RichTextEditor1.HtmlText
 }
)

 You could also always Update the First record with 

First(DATASOURCE)

 

But that doesnt make much sense. (IT also has a really high delay)

 

I suggest you, to work with IDs or Title. You need at least a unique identifier.

 

To explain the Patch to you basically. 
You need the Datasource, the record you want to modify and than what you want to modify.

 

Hope I could help you.  

 

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.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

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 (2,744)