Appian Community and Appian Academy are being upgraded. As a part of the upgrade, Appian Community is currently in read-only mode, and user registration is disabled until August 3. We apologize for any inconvenience this may cause, but a more secure, stable, and performant Community experience is coming soon!
The new Appian Community launches August 3, followed by Appian Academy on August 7. During the migration, Appian Community Edition, Appian Academy, Documentation, Certifications, Instructor-led Customer Training, Partner Sales Training & Accreditation, and Forum (for Appian Partners and Customers only) will remain available.
I have a requirement where in a text field needs to be formatted in a specified format of "X.1234567", where 'X' and '.' will be a constant followed by 7 digits.If we are typing 123 in the text field, it should be formatted to "X.0000123". Any help would be appreciated.
Thanks!
Discussion posts and replies are publicly visible
What will the user standardly be expected to type? What range of allowed input will there be? Is the text following "X." only ever going to be essentially an integer?
Will the formatted value of "X.0000001" etc be for display purposes only or would we want the *actual stored* value to reflect that text as well?
Users may type any characters or numbers then that should be taken care with validation messages, but when numbers are entered, it should be formatted as "X.seven digits", scenario1 : If user has entered 123 in the fiels, then formatting should make the field value as "X.0000123"scenario 2: If user has entered 1234567, the formatting should make the field value as "X.1234567"Anything apart from this, should throw validation error.
Also, Will the formatted value of "X.0000001" etc be for display purposes only or would we want the *actual stored* value to reflect that text as well? ---> Formatted value should be for display in the text field and separately this has already been taken care at back end as we are using external database.
Try this - it doesn't even allow the user to enter anything that would throw a validation error (as far as i can tell), as it automatically reformats any number or text entered into the desired result. It also (by brute force) caps the length of the number following "X." to 7 total digits. You may need to adjust slightly, depending on the particular behavior you want.
a!textField( value: local!text, saveInto: { a!save( local!text, left( "X." & text( todecimal(cleanwith(save!value, "0123456789")), "0000000" ), 9 ) ) } )
Thanks Mike for your reply!. This helped.