Expression rule to format address

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

Parents
  • +1
    Certified Senior Developer

    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)
        },
        ","
      )

Reply
  • +1
    Certified Senior Developer

    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)
        },
        ","
      )

Children
No Data