How do I format numbers in pop-ups for web appbuilder applications?

5205
10
08-11-2015 07:08 AM
BrandonKeinath1
Occasional Contributor III

Hi all,

I'm attempting to fix a number formatting issue in the edit pop-up in a web appbuilder application.  I would like the numbers to display without the thousand seperator but I'm not able to make changes appear when I edit the config_Edit.json file.  Is it being over-ridden by something else in the code?  Any ideas would be helpful.

{ "fieldName": "ACCOUNTNUMBER",

  "label": "Account Number",

  "format":{

  "places": 2,

  "digitSeparator": false

          },

  "isEditable": true

},

Thanks,


Brandon

0 Kudos
10 Replies
DanNorman
Occasional Contributor

Hey Brandon, I am assuming you want to do it by editing the .json files to which i dont have an answer...

But just in case you were not aware and if you are creating maps in arcgis online you can do it here (image provided):

PopupConfig.PNG

BrandonKeinath1
Occasional Contributor III

Hi Donald,

You are correct that I would like to do it via code.  We do use the arcgis online web map as the base to our web appbuilder application but it (the map) doesn't seem to respect the field formatting I set in the service.  And changing all the fields for each web map it gets used in is frustrating.  Have you seen this behavior of the service formatting not transferring to web map or is it unique to us?


Thanks,


Brandon

0 Kudos
DanNorman
Occasional Contributor

Sorry I haven't seen that behavior, our formatting always persists to the app (AGOL WAB, and WAB developer).

BrandonKeinath1
Occasional Contributor III

Hi Donald,

Can you tell me the workflow you follow for publishing your services?    Do you need to visit the Number Format section of the fields properties?   It sounds like there may be something you're doing differently than I am or that it's something I should follow up with esri on.  The fields I'm looking at are "Long" type.  What type are yours?

Brandon

0 Kudos
DanNorman
Occasional Contributor

Hey Brandon, workflow below... i do not need to visit the number format section of the fields properties in arcmap, i do need to visit the configure attributes in arcgis online..... using the configure attributes dialog is successful for me with long type integers and double type.

We are are publishing desktop 10.3.1 mxds containing spatial views and regular feature classes. These are published on arcgis server 10.3.1 and the services are added to arcgis online "my content". the services are then added to a map where we configure the attributes for decimal places and thousand separators. The field i was referring to was of type double which arcgis online by default checks the 1000 separator so i uncheck it, save the popup, save the map, craete a new application (developer or web app builder through arcgis online) and the thousand separator successfuly does not show up on someones street address.

All that said i just performed a test on a regular feature class in our 10.3.1 sde where i displayed a popup for a long integer field, formatted it to exclude 100 separator, and it persists all the way to the application.... unfortunately i cant share the app as its internal.

is your workflow much different?

BrandonKeinath1
Occasional Contributor III

Hi Donald,

No that is our workflow as well; I'm happy to see other people using Spatial Views!  You are right that the formatting persists when you edit the pop-up in AGOL.  I had hoped to cut out the pop-up formatting step in ArcGIS online purely out of laziness.  I don't really like the user interface for pop-up configuration (compared to ArcMap) and I've been burned in the past having users un-check the pop-up in AGOL and having to re-do all my formatting.  I don't know if this issue still exists but it was painful enough I've been reluctant to test it again.

I'm still interested in the code solution but I think I'll post in another portion of geonet that is more appropriate.  If you're interested, or other in the future, I can share the link here.

Thanks for your help!

Brandon

0 Kudos
DanNorman
Occasional Contributor

I would recommend leaving this question as unanswered as we still dont have a programmatic fix.

Here is one thing to note in regards to you loosing configuration information: when you add a service to my content, and then add that service to any AGOL map, then edit any configuration about any of the layers within the service, you can save those changes to the "my content" instance of your service when you select save from the service's dropdown in AGOL map. ie, the popup configuration you setup for one or many layers in the service is saved within the my content item independent of whether or not you happen to save the AGOL map. You can also have multiple my content additions of the same service with different configurations and then make copy to backup of the configurations you like. Copying and saving service instances is done from the services drop down in AGOL map.

DanNorman
Occasional Contributor

and after the instance of the service is saved in the AGOL map, those changes persists to any other map you add it to, or allready have it in.

BrandonKeinath1
Occasional Contributor III

Hi Donald,

I've done as you suggested and left this unanswered.  I wasn't aware of the ability to save out service configuration changes from AGOL.  Does this get confusing in terms of naming or searching for layers in AGOL?  I can envision a scenario where I've saved out three different service configurations and a user might get confused about which they should use.

Brandon

0 Kudos