How to remove Carriage Return from String while inserting into database

Hi All,

 

We are using Portal designed forms and we have a requirement to get Feedback from Customer and it is a Paragraph Field.

Since it is a Paragraph Field, customers are giving Feedback in the form of new lines, like below

Hi

This is a Requirement

Here is a issue

We have to solve

When this data is inserted into Database (SQL Server) it is getting inserted as below.

Hi
 This is a Requirement
 Here is a issue
 We have to solve

For this we tried to solve by using below expression

difference(split(ac!additionalInformation,char(13)),{char(13)})

but the result for this is  Hi, This is a Requirement, Here is a issue, We have to solve.

Now we have to remove comma from this so we tried below expression but that did not work

difference(split(difference(split(ac!additionalInformation,char(13)),{char(13)}),char(44)),{char(44)}).

 

Note: If user gives comma in the string it should not be removed.

Please help us in resolving this issue.

 

Thanks in advance.

  Discussion posts and replies are publicly visible

Parents Reply
  • 0
    Certified Lead Developer
    in reply to someshwarp
    Just be advised that both char(13) and char(10) are used for line breaks depending on the type of form (portal vs. tempo or sail); last I checked, portal forms actually submit BOTH char(13) and char(10) with each linebreak, whereas tempo/sail uses only char(10). (I could be slightly off, it's been a while since I last dealt with this, but it was something very close to this at least).

    I'm not sure if you're seeing different results or not, but you might need to check and account for this.
Children
No Data