Popup re-formats desired values

759
4
Jump to solution
05-26-2017 08:37 AM
JamesCrandall
MVP Frequent Contributor

We have a hosted feature layer that published from a feature class in a file geodatabase.  The attributes in the columns are formatted in a specific desired way so as to have padded spaces between characters in these TEXT columns.  As seen in the attribute table itself:

 

For the feature layer after it is uploaded and a hosted feature layer is created, we set a custom attribute display and configure the columns as required:

However, in the actual popup it seems to re-format the values and removes the padding/spaces between the characters:

Is there any way to prohibit this from happening or an alternative workaround?

0 Kudos
1 Solution

Accepted Solutions
RandyBurton
MVP Alum

James,

You should be able to use field calculator or something similar to replace spaces (ASCII 32) with non-breaking spaces (ASCII160).  I was using a REST API query/update for my testing.  Since the non-breaking space is a special character in html, it uses a special escape sequence.  AGO will use this escape sequence, so you get non-breaking spaces.  When you string several non-breaking spaces together, you will get the desired padding in the map's pop-ups.  The web browser will not combine non-breaking spaces into a single space.

View solution in original post

4 Replies
RandyBurton
MVP Alum

It might be an HTML thing where spaces get combined.  Have you experimented with non-breaking spaces?

UPDATE:

I did some testing with AGO and replaced spaces with non-breaking spaces (ASCII 160) in a test field. AGO replaced them with the proper html escape codes when displaying them.

JamesCrandall
MVP Frequent Contributor

Thanks Randy,

Could you clarify?  Are you saying that in your testing AGO automatically removed the spaces?  

If so, then I would assume there's nothing that can be done to stop this.

Thanks again!

Take care.

0 Kudos
RandyBurton
MVP Alum

James,

You should be able to use field calculator or something similar to replace spaces (ASCII 32) with non-breaking spaces (ASCII160).  I was using a REST API query/update for my testing.  Since the non-breaking space is a special character in html, it uses a special escape sequence.  AGO will use this escape sequence, so you get non-breaking spaces.  When you string several non-breaking spaces together, you will get the desired padding in the map's pop-ups.  The web browser will not combine non-breaking spaces into a single space.

JamesCrandall
MVP Frequent Contributor

Oh!  Okay understood!


Thanks for the suggestion!

0 Kudos