I have the following Rich Text Editor field inside my sharepoint online with internal name = "ApproverFeedbackandnotesPowerBi":-

enter image description here

and inside my remove event receiver i am checking the Current Value of this field against the After value as follow:-

public SPRemoteEventResult ProcessEvent(SPRemoteEventProperties properties)
             SPRemoteEventResult result = new SPRemoteEventResult();
             using (ClientContext clientContext = TokenHelper.CreateRemoteEventReceiverClientContext(properties))
                     if (clientContext != null)
                         ListItem currentItem = clientContext.Web.GetList(clientContext.Web.ServerRelativeUrl + "/lists/ApprovalProcess").GetItemById(properties.ItemEventProperties.ListItemId);
                         if (properties.ItemEventProperties.AfterProperties["ApproverFeedbackandnotesPowerBi"].ToString() != (currentItem["ApproverFeedbackandnotesPowerBi"] == null ? null : ToString())

now the check will always fails, so when i debug my code i have noted that the currentItem["ApproverFeedbackandnotesPowerBi"] will always have extra html tag (<div class="ExternalClassD7C94EE0628F493686BC675B96532912">), for example, in one case the currentItem["ApproverFeedbackandnotesPowerBi"] =

<div class="ExternalClassD7C94EE0628F493686BC675B96532912">&#128993;Abstain By&#58;- . Comment&#58;-  Nothing was attached..<br>✅Approved By&#58;- . Comment&#58;-...<br><br></div>

while the properties.ItemEventProperties.AfterProperties["ApproverFeedbackandnotesPowerBi"] =

 &#128993;Abstain By&#58;- . Comment&#58;-  Nothing was attached..<br>✅Approved By&#58;-. Comment&#58;-...<br><br>

so can anyone advice why this is happening? and how i can fix it, so my comparison will work correctly?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.