Display remaining character count

3413
11
Jump to solution
05-26-2017 06:39 AM
JoeFlannery
Occasional Contributor III

Is there a way to display to the survey user, the remaining characters available for a text input field?  Similar to what one sees when authoring a tweet in Twitter?

CharacterCount

1 Solution

Accepted Solutions
JohnathanHasthorpe
Esri Regular Contributor

As of 3.1, the character count will now be displayed on text questions in the field app.

View solution in original post

11 Replies
MichaelKelly
Occasional Contributor III

This is not currently possible without creating a note below the field and doing a calculation - the string-length function would be useful in this case. It is a good enhancement request though so I would suggest you submit it to the ArcGIS Ideas site.

DanielMcIlroy
Occasional Contributor

Thanks Michael, this is very helpful and a good way to deal with this issue.

Just something that has been bothering me and that I haven't been able to find a quick answer to; Is a note field written to the final database or is for display only?

0 Kudos
MichaelKelly
Occasional Contributor III

That depends on whether you specify a name for the database field name. Below only the second note is stored:

typenamelabelcalculationbind::esri:fieldLength
textexampleExample500
noteCountconcat(string-length(${example}), ' of 500')
noteexampleCountStoredCount Storedconcat(string-length(${example}), ' of 500')

As can be seen in the Schema Preview:

As can be seen in the example above, you can also change the length of a string if needs be using the bind::esri:fieldLength column.

DanielMcIlroy
Occasional Contributor

SUPER helpful! Thank you very much!

MichaelKelly
Occasional Contributor III

More than welcome Dan 

0 Kudos
MichaelKelly
Occasional Contributor III

Just a quick note to say that this functionality is available in the web client (i.e. when the survey is viewed through a browser):

https://survey123.arcgis.com/share/f2159e91f5c24f3495753fe68a9040f5 

and the next generation forms (currently in beta)

https://survey123.arcgis.com/webclient/f2159e91f5c24f3495753fe68a9040f5

It's just not available in the mobile app yet.

JoeFlannery
Occasional Contributor III

Michael:

Thank you for your time and input to this thread.  Your solution, above, works fine, but is not dynamic, that is, does not show the user how many characters remain in the limit as they are typing.

Also, your comment on "note" items being committed to the database as asked by Dan McIlroy.  It appears to me, from my Survey123 forms, that a "note" item is not by default committed to the database when the "name" field is populated with a value (see first screen capture).  If a "calculation" is included with the note, then the note is committed to the DB (see second screen capture).

Note without "calculation"

 

Note with "calculation"

0 Kudos
JohnathanHasthorpe
Esri Regular Contributor

As of 3.1, the character count will now be displayed on text questions in the field app.

TedChapin
Occasional Contributor III

This is awesome! Now how do you turn it off?

0 Kudos