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.
While trying to check an empty map, a!isNullOrEmpty and a!isNotNullOrEmpty are not working, rather giving opposite result.
The result of
a!isNullOrEmpty(a!map())
Discussion posts and replies are publicly visible
I made this edge case part of my universal null check.
if( local!typeNum = 'type!{http://www.appian.com/ae/types/2009}Map', /* Has no keys at all or all values are null */ or( length(a!keys(ri!value)) = 0, all(a!isNullOrEmpty(_), index(ri!value, a!keys(ri!value), null)) ),
Hmm, it does seem odd - that being said, I'm pretty sure behind the scenes this function is just doing a length() check on the value. If I do length(a!map()) it returns 1, so that's probably why this is returning false.
If you'd like, you could probably submit a support case and have the team investigate it. My hunch though is that it is behaving as expected given the result using the length function.
I have seen this happen multiple times within process models if we get an empty CDT map as a result and try to use this function to verify if it is empty. So I usually check one of the CDT's not null parameter to determine if the value is actually empty. if you are using a map, better to check either a not null key or all the keys.