Appian Community and Appian Academy are being upgraded. From July 24–August 3, the Appian Community will be in read-only mode. During this time, the site will be read-only and user registration will be disabled. 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.
Short of creating a constant that contains all valid icons and richTextIcons (which is suboptimal given that icons are updated between Appian versions), is there a way to make icons "invalid icon"-safe?
i.e. Checking if an icon is in the list of supported icons on a given appian version before passing it into icon or richTextIcon?
Context
We have a (larger, complex) application that dynamically determines which icon to use in a richTextDisplayField.
One can be thorough and investigate the root cause of why invalid values are being populated but I would like to be thorough and double-check.
Thanks!
Discussion posts and replies are publicly visible
I didn't actually know this before, but after a quick test in my environment I've found that when an invalid icon name is provided, a!richTextIcon() will return a dictionary of data wherein one of the properties is "isError" and a value of "true".
This leads me to think that if you have a strong enough use case for this, you could set up an expression rule i.e. "MYAPP_Util_isValidIconName()" where you pass in the name and it returns TRUE if the result was valid and FALSE otherwise... it seems to execute pretty quickly. Note this would be technically "unsupported" functionality meaning the back-end workings could change in the future with no notice, hence why I recommend only doing this if you have a strong reason for it, and wrapping the functionality in an expression rule and only using that (instead of hardcoding it in).
if( property(a!richTextIcon(icon: ri!iconName), "isError", false()), false(), true() )
Completely agreed regarding undocumented functionality. Thank you for the quick response!