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.
I am querying data to get address but when the value is null I am getting ",,,,,". How to remove this comma if fields are not there
trim(concat( property(local!address,"fullName",null), property(local!address,"buildingNumber",null) & ", " & property(local!address,"streetName",null) & ", " & property(local!address,"district",null) &", "& property(local!address,"unitCode",null) &", " & property(local!address,"cityName",null) & ", " & property(local!address,"zipCode",null) ) )
Discussion posts and replies are publicly visible
There are two ways of doing it. The longer and more reliable way is to check every property statement for null and if it is null, then do not pass the entire statement rather just pass an empty string.
trim( concat( property(local!address, "fullName", null), if( a!isNullOrEmpty( property(local!address, "buildingNumber", null) ), "", property(local!address, "buildingNumber", null) & ", " ) ) )
The shorter way is just to substitute ",," with "" so that whenever a value is skipped, you can just replace the entire block. It has some exception cases tho. Like when 1 out of 3-4 property functions is not returning the statement.. In that case, it will remove all the commas between the two.
substitute(trim(",,,,,,"), ",,", "")
Or you can use the joinarray.
You can use joinarray function like below
joinarray( { property(local!address, "fullName", null), property(local!address, "buildingNumber", null), property(local!address, "streetName", null), property(local!address, "district", null), property(local!address, "unitCode", null), property(local!address, "cityName", null), property(local!address, "zipCode", null) }, ", " )
Please try to use joinArray.
joinarray( { property(local!address, "fullName", null), property(local!address, "buildingNumber", null), property(local!address, "streetName", null), property(local!address, "district", null), property(local!address, "unitCode", null), property(local!address, "cityName", null), property(local!address, "zipCode", null) }, "," )
Hi Harshit, the Joinarray function worked