I have a workflow that pulls text from a multi-line append text field. I have everything working, except if a user copies and pastes data from another application into the field on the form. When that happens, span class and font tags are embedded into the comment string.
I am looking for a solution, using Regular Expression, to remove the span and font tags, but leave the text within those tags, so I have a complete comment.
needs feedback if <span style="font-family:"calibri",sans-serif;font-size:11pt;"><font color="#000000">maintenance, support and service fees</font></span> are involved and...
I need to remove the everything in Red font, so the out looks like:
needs feedback if maintenance, support and service fees are involved and...
The timing of your question is great because I was working on a solution for this today. It can be achieved via workflow using Regular Expression actions. I'm using Nintex Workflow 2013.
To remove all the tags related to the SPAN and FONT, you'll need four Regular Expression actions. You can order them in any way, but here's the order that worked for me.
This should remove all the SPAN and FONT tags from your text. You can use the Run Now button in the Regular Expression action to test these out.
if you do not expect any valid substring surrounded with angle brackets you can simplify regular expression like follows.
it will take care of any opening or closing tag at once
Thank you both very much!!! That seems to have done the trick: <[^>]+>
I do have some concerns, but not sure if this change is causing it, or something else is causing it. When new comments are added, the oldest comment is being deleted from the comments box (multi-line text box w append changes). I didn't think there was a limit, to the amount of comments, and I know there are records with a lot of appended comments, and none were deleted before.
Since I incorporated the change, I have 2 records that it is deleting the oldest comment.
Comment history for 1 record, after running the incorporated change on the workflow:
User3 (9/13/2018 8:27 AM):
User3 (9/10/2018 10:29 AM):
User3 (9/6/2018 10:19 AM):
User3 (9/5/2018 1:49 PM):
User2 (8/23/2018 2:16 PM):
User1(6/27/2018 10:46 AM):
User1 (6/25/2018 11:10 AM):
What is stored in the new comment field after the workflow is run:
User3 : 2018-09-13 08:27:56 : Comment
;User3 : 2018-09-10 10:29:09 : Comment
;User3 : 2018-09-06 10:19:39 : Comment
;User3 : 2018-09-05 01:49:38 : Comment
;User2 : 2018-08-23 02:16:09 : Comment
;User1 : 2018-06-27 10:46:49 : Comment
;User1 : 2018-06-25 11:10:55 : Comment
;User1 : 2018-06-13 03:42:53 : Comment ; This comment is no longer included in the Comment Text box on the form. I'm afraid the next time a comment is entered on this record, this comment will no longer exist and therefore not be loaded into the new comment field. (***My workflow clears out the new comment field each time it runs...so historical data is not saved...not sure how to rework the workflow to just append the newest comment to the existing data).
Any idea what could be causing the oldest comments to be deleted from the comment field on the form?
I have a screen shot below of the Versioning Settings screen. I believe it looks like 15 versions. So, would that mean, after 15 comments are added it would start dropping them off? Or would it be after 15 times of going into the request to make any sort of edit, it would start losing the history? The earlier scenario only had 8 comments when it ran and deleted the oldest one.