How to stop Text Field reformatting dates?

835
11
Jump to solution
10-31-2023 05:45 AM
Labels (2)
Savannah2019
New Contributor III

So I've noticed that text fields in arcgis online are reformatting dates. How do I stop this? I made it a text field for a reason. I want "October 2023" to appear, not "10/1/2023". The only way I can get it to stop doing this is to put in extra text, but I don't want that.

Please see the photos:

What I've written:   Savannah2019_0-1698756214937.png

What appears in the pop-up:  Savannah2019_1-1698756253212.png

 

Help!

0 Kudos
1 Solution

Accepted Solutions
RussRoberts
Esri Notable Contributor

I think I found the issue

- If you can open the web map in https://ago-assistant.esri.com/

- Check the field under fieldinfos and see if the property format exists. 

- If a format exists and it says shortdate

- if its there you can delete it from the JSON in the assistant

RussRoberts_0-1698765076672.png

 

What caused this? I think possibly the original map created had the layer being used the field was originally a date field. The layer was overwritten and the field was changed to a string field but the web map still contained the date formatting.

View solution in original post

11 Replies
RussRoberts
Esri Notable Contributor

Can you share your map and I can take a look? thanks!

0 Kudos
Savannah2019
New Contributor III

Unfortunately, no. It has some internal information, so I can't.

0 Kudos
RussRoberts
Esri Notable Contributor

Are you setting the formatting on the fields

RussRoberts_0-1698758809774.png

 

0 Kudos
Savannah2019
New Contributor III

It's a text field, not a date field, so I don't even have that option. That's what is so confusing to me!

Text field: Savannah2019_1-1698759060407.png

Formatting options:  Savannah2019_0-1698759035189.png

 

I can add additional text and it'll stop trying to convert it to a date, but it isn't ideal:

Savannah2019_2-1698759298779.png

 

 

0 Kudos
RussRoberts
Esri Notable Contributor

Can you see what the service returns for that feature through the REST endpoint? I checked against a text field and the string October 2021 was not adjusted with formatting. If you can create a repro case using some other data or map that would be great too. 

0 Kudos
Savannah2019
New Contributor III

I tried to create a new point feature class and it's not doing it, so I'm really not sure why this one just started acting up. I assumed it had to do with the most recent AGO update, but if it's only this feature layer that's affected, I'm at a loss.

Can you tell me where to look for the REST endpoint? Should I be looking for something specific? Looking at the rest services page, the only line about it says: 

  • ScheduledStart (type: esriFieldTypeString, alias: Scheduled Start, SQL Type: sqlTypeOther, length: 50, nullable: true, editable: true)
0 Kudos
RussRoberts
Esri Notable Contributor

I think I found the issue

- If you can open the web map in https://ago-assistant.esri.com/

- Check the field under fieldinfos and see if the property format exists. 

- If a format exists and it says shortdate

- if its there you can delete it from the JSON in the assistant

RussRoberts_0-1698765076672.png

 

What caused this? I think possibly the original map created had the layer being used the field was originally a date field. The layer was overwritten and the field was changed to a string field but the web map still contained the date formatting.

Savannah2019
New Contributor III

Thank you! This worked beautifully 😄

I think yes, when I first created this, it was an actual date field, but I realized that wouldn't work in all cases. 

Savannah2019
New Contributor III

Ok- update: I put the layer in a new map- no issue. It's something to do with the map it's already in. Any ideas what could be causing it? It's not in an attribute expression, it's just selected from the fields list. 

0 Kudos