Showing results for 
Search instead for 
Did you mean: 
Level: Powered On

Patch and richtext carret/prompt



As my users close the powers apps windows or swith for a Team tab to another, they loose their record...


I setup a timer, and patch richtext in order to update my SP list


when it's done, the prompt/carret is set on the beginning of the richtext... My solution does not work, how to you handle such needs ?


Thx in advance


Microsoft Employee

Re: Patch and richtext carret/prompt

Hello @Jdriele ,

I don't think there's a way to get/set the cursor position in the RichTextEditor control. Are you using the RichTextEditor.HtmlText in your Patch function? Have you tried storing the content in a variable on every change (RichTextEditor1.OnChange=Set(copy, RichTextEditor1.HtmlText)) and then patch that variable? If that does not work, I would recommend having a "dirty" flag (RichTextEditor1.OnChange=Set(isChanged, true)) and have a red border around the RichTextEditor when it is true (optionally, you can unhide a warning message as well letting the user know that the changes are not saved). When user saves the content, you can reset the flag (and hide the message).

Hope that helps.

Level: Powered On

Re: Patch and richtext carret/prompt


Here my code (with or without variable return the same problem)

UpdateContext({autosaveBody: RichTextBoxBody.HtmlText});
UpdateContext({autosaveFeedback: RichTextFeedback.HtmlText});
UpdateContext({autosaveID: galleryTopics.Selected.ID});


Dirty flag, why not but it does not solve the problem of my users.
The cursor/carret move because of Patch (only if new data)



Patch is needed as the risk is that people 

  1. close tab in web browser
  2. change tab in Teams

So far, Powerapps didn't alert user when he closes tab (1) or change (2)