Service Desk Practitioners Forum
cancel

Removing carriage returns from description field

Highlighted
Craig R Taylor
Honored Contributor.

Removing carriage returns from description field

One issue I have come across is that users will occasionally add carriage returns to the description field. Within the records itself, it appears fine. However, when show a list of the records every one that contains a carriage return has a box in place of the carriage return. Is there a way to strip out carriage returns (or other special characters) in a field?
You can observe a lot just by watching. - YOGI BERRA
11 REPLIES
Mike Bush
Acclaimed Contributor.

Re: Removing carriage returns from description field

Craig - I used a trigger on one site but that's probably not the reply you wanted.
Dan Ioan
Honored Contributor.

Re: Removing carriage returns from description field

Hi Craig,
Try to do the following:
1. Export your data in a .CSV file instead of XLS! (No boxes related with CR in this file)
2. Open this file and replace all "'" with nothing!
3. Save file in MS Excel 97-2000 workbook format.
Hope this helps you,
Regards,
Dan
Utku Sertan Elg
Respected Contributor.

Re: Removing carriage returns from description field

Hi Craig, try out Dan's workaround, it seems fine. Please notify whether it is ok or not. A trim functionally should also take place when performing data exchange. good luck

Sertan
Craig R Taylor
Honored Contributor.

Re: Removing carriage returns from description field

I was thinking terms of a UI or DB rule to replace the carriage return character. Sorry I forgot to mention this initially but we are using Service Desk 4.5 sp 11.

Thanks
You can observe a lot just by watching. - YOGI BERRA
Mark O'Loughlin
Acclaimed Contributor.

Re: Removing carriage returns from description field

Hi,

there are functions available in Update Data in the rules which can e.g. trim characters left or right. these coule be used in rules however you may be restricted from achieving what you want to be as there may be different ammounts of carraige returns in the field - you could remove too much or to little.

Something to look at though and see how it could be applied.
Craig R Taylor
Honored Contributor.

Re: Removing carriage returns from description field

I am not sure what I did before that caused me problems, but I tried to use the "substitute for" function again and this time it worked just beautifully.

The UI looks something like this

Before the item is saved
where NOT (Description is empty)
IN - remove carriage returns (Update Data) Description set to (Substitute for [Description] )

When I was prompted for the string I put in an enter. For the replacement value I put in a space.

Thanks again for everyone's input
You can observe a lot just by watching. - YOGI BERRA
Caroline Kraaij
Respected Contributor.

Re: Removing carriage returns from description field

We are also interested in replacing returns with e.g. spaces, but we are curious how to put this into an UI rule. In other words: what to enter (and where) for a return and what for a space. Thanks in advance!
Craig R Taylor
Honored Contributor.

Re: Removing carriage returns from description field

In the UI rules area for incidents (and you can repeat this for each module) I did the following:

Apply this rule:
Before the item is saved
Condition:
NOT Description is empty (I used this because SP 11 doesn't have the option to check to see if the field has any value)
Actions:
Added an update data action
Description set to
Function (in next screen) The function to use is Substitute for.
Value is Description
String is [enter] (Need to double click on String to get a new window open on its own to put the enter in)
With is just a space

Hope that explains it well enough. One thing to note is that users of SD 5.0 have been reporting issues with putting a plain space in some of the fields when creating rules so this might not work on the current version SD 5.0




You can observe a lot just by watching. - YOGI BERRA
Caroline Kraaij
Respected Contributor.

Re: Removing carriage returns from description field

Thanks Craig!

However, I cannot get it working. In our version (4.5 SP14)'string' is not 'doubleclickable'. When I click the icon right of the string-field, I get another screen like where I selected the 'substitute for' function, i.e. with 3 radio buttons (fixed value, attribute or function) and I cannot find a way to put an enter in here. Do you know in what field to put the enter and how? Thanks again in advance!
Craig R Taylor
Honored Contributor.

Re: Removing carriage returns from description field

Another way of putting in the enter is type in %line.separator%
You can observe a lot just by watching. - YOGI BERRA
Craig R Taylor
Honored Contributor.

Re: Removing carriage returns from description field

Solution shown in earlier posts
You can observe a lot just by watching. - YOGI BERRA