To use the atribute {% if service_attributes.pat is not empty %} Mikrotik-Address-List = pat {% endif %}, you need to work with a field in the internet service, is not posible with fields in custom service. If you want also to use as bolean, the correct attribute is: