Select to view content in your preferred language

New Lines Not Honored in Pop-up

2468
3
Jump to solution
05-05-2021 08:40 PM
PeterT_Brisbane
Regular Contributor

I've got a large text field which has new line characters (CRLF).

In ExB they're being represented correctly in the text widget, but not in the popup in the map widget.

Classic Map Viewer represents correctly, but new Map Viewer doesn't.

It appears ExB is honoring the new Map Viewer, but not Classic.

Any ideas?

GIS_Unit_Kedron_1-1620271915276.png

GIS_Unit_Kedron_2-1620272008100.png

 

Peter T, Brisbane
0 Kudos
1 Solution

Accepted Solutions
jcarlson
MVP Esteemed Contributor

It looks like carriage returns are inconsistent. Here's an expression:

'Line followed by "\\n"\n' +
'Line followed by "TextFormatting.NewLine"' +
TextFormatting.NewLine +
'Line followed by "\\r"\r' +
'Final Line'

In the expression builder, it gives me this:

jcarlson_0-1620302647479.png

Which is what I'd expect. But in the popup:

jcarlson_1-1620302770028.png

Would it be a simple matter to just replace the carriage returns with newlines?

- Josh Carlson
Kendall County GIS

View solution in original post

0 Kudos
3 Replies
jcarlson
MVP Esteemed Contributor

It looks like carriage returns are inconsistent. Here's an expression:

'Line followed by "\\n"\n' +
'Line followed by "TextFormatting.NewLine"' +
TextFormatting.NewLine +
'Line followed by "\\r"\r' +
'Final Line'

In the expression builder, it gives me this:

jcarlson_0-1620302647479.png

Which is what I'd expect. But in the popup:

jcarlson_1-1620302770028.png

Would it be a simple matter to just replace the carriage returns with newlines?

- Josh Carlson
Kendall County GIS
0 Kudos
PeterT_Brisbane
Regular Contributor

Unfortunately I have very little control over the data coming into attributes.

We settled on removing the popups and relying on a text window.  At least it's consistent.

Thanks.

Peter T, Brisbane
0 Kudos
jcarlson
MVP Esteemed Contributor

What about using Arcade's Replace function? I know you already went with a different solution, but may be worth looking into.

var out_str = ' 1 \r 2 \r 3'

var replaced = Replace(out_str, '\r', '\n')

return 'Original:\n' + out_str + '\nReplaced:\n' + replaced

jcarlson_0-1620824478262.png

 

- Josh Carlson
Kendall County GIS
0 Kudos