Parsing text from cell to html tag - Losing format

Hi,

I am having a problem parsing text I am reading with a google read cell activity to an html tag. The cell I am reading contains multiline text, but when parsing this to an html tag, the expected output is different from expected. I need the output text to be exactly the same as the cell contents. In the example noted below, instead of having a multiline text output, I am getting a single line output.

Example of content in cell

Dummy text

This is an example dummy string

When parsed to html p tag

Dummy text This is an example dummy string

Is it possible to maintain the multiline formatting? If so, how can this be achieved?

Hello @Shanny ,

You mean you have wrapped text into the cell or in the same cell you have the sentence in the another line and you want it as it is in the output ?

Thanks,
Sanjit

Hi Sanjit,

The text is not wrapped. The cell just contains multiline text which I want to parse as is to the html p tag. Essentially, the desired output should be:

Dummy text

This is an example dummy string

I will need to extract multiple cell values from the same Google sheet, and the majority of them are multiline text strings

Hi @Shanny ,

Assuming the content is present in a single block of string like so:

str_variable = "Dummy text

This is an example dummy string"

We can replace the extra newline with a
tag and that will push it to the next line.
image
image
image

System.Text.RegularExpressions.Regex.Replace(str_variable,"(?<=\r?\n)\r?\n","<br>")

textToHTML.xaml (6.4 KB)

Kind Regards,
Ashwin A.K

Many thanks Ashwin.

Hi @Shanny ,

Is the solution I’ve provided above satisfactory?
If so then I’d appreciate it if you could mark the answer as Solution so that others facing similar issues may benefit from it, and also to close this thread.

If this is not what you were looking for then additional details would be most appreciated.

Kind Regards,
Ashwin A.K

Hello @Shanny

Can you please share a sample?

If you need to modify the normal string to html tags, you can use Create HTML Content activity.

Thanks

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.