Character limit of the question "Label" field?

933
6
05-02-2023 04:55 AM
MichaelBishopp
Occasional Contributor

I am trying to determine the character limit of the label field in a question of a Survey123 survey.  I believe it is probably 256 characters, but wanted to check and see if anyone knows the exact character limit of this field.

Thanks!

0 Kudos
6 Replies
Katie_Clark
MVP Regular Contributor

I can't give you an answer for a specific character limit off the top of my head, but I know I've used extremely long blocks of text using HTML to create a table to display in the survey (it was a null field type though, not sure if that would overwrite any kind of character limit?)

Best,
Katie


“The goal is not simply to ‘work hard, play hard.’ The goal is to make our work and our play indistinguishable.”
- Simon Sinek
0 Kudos
IsmaelChivite
Esri Notable Contributor

@MichaelBishopp 

I agree with @Katie_Clark , you can make Survey123 question labels really long.  Just for fun, today I created a label with 133,000 characters, and it did work fine in both the mobile and web apps. The text is longer anyone would every want to read! 🙂

In practice, what bites you is not the limit on the Survey123 labels, but the limit on the ArcGIS field alias. When you publish a survey, the label of the question is used to populate the field alias. That is where you are going to get errors, while publishing. So here are a few recommendations:

  • Specify the field alias using the bind::esriFieldAlias column in your XLSForm (limit is 255 characters). 
  • Set the bind::esriFieldType value to null (like @Katie_Clark did)
  • If the label belongs to a note question type, do not specify a value in the name column
Katie_Clark
MVP Regular Contributor

Thanks for elaborating, @IsmaelChivite !

Just clarifying, is that a typo in your second bullet point? It's bind::esriFieldType value to null, correct? 🙂

Best,
Katie


“The goal is not simply to ‘work hard, play hard.’ The goal is to make our work and our play indistinguishable.”
- Simon Sinek
MichaelBishopp
Occasional Contributor

Maybe I’m misunderstanding, but I don’t think you’all understand the question. The Label is NOT a database field value, but a field name. I realized that the limitation is the length allowed by Esri’s Datastore’s Postgres database configured NAMEDATALEN. Since this is hidden from us, I will assume the length limit is 63 bytes.
Bing Search (ChapGPT)
The search results indicate that the limit of the field name length in a PostgreSQL database is **63 bytes**¹²⁴. This means that identifiers such as table names, column names, constraint names, etc. are limited to a maximum length of 63 bytes. Identifiers longer than 63 bytes can be used, but they will be truncated to the allowed length¹⁴. The limit is determined by the value of **NAMEDATALEN**, which is 64 by default²⁵. NAMEDATALEN can be changed in the source code before building PostgreSQL, but this is not recommended³.
Source: Conversation with Bing, 5/2/2023
(1) https://til.hashrocket.com/posts/8f87c65a0a-postgresqls-max-identifier-length-is-63-bytes#:~:text=In..... https://bing.com/search?q=field+name+length+postgres.
(2) How long can PostgreSQL table names be? - Stack Overflow. https://stackoverflow.com/questions/27865770/how-long-can-postgresql-table-names-be.
(3) PostgreSQL's Max Identifier Length Is 63 Bytes - Today I Learned. https://til.hashrocket.com/posts/8f87c65a0a-postgresqls-max-identifier-length-is-63-bytes.
(4) PostgreSQL: Documentation: 7.0: Names. https://www.postgresql.org/docs/7.0/syntax525.htm.
(5) Increasing Postgres column name length - Stack Overflow. https://stackoverflow.com/questions/63511001/increasing-postgres-column-name-length.

0 Kudos
IsmaelChivite
Esri Notable Contributor

@MichaelBishopp  It looks like we got lost in translation. This link may be helpful to you: https://pro.arcgis.com/en/pro-app/latest/help/data/geodatabases/manage-saphana/enterprise-geodatabas...  

MichaelBishopp
Occasional Contributor

I realized that the "Label" field is actually creating an alias for this field name (it is shortened automatically by Esri for the actual field name).  So the alias field name length max is 255 based on @IsmaelChivite URL share.

0 Kudos