COALESCE(a, b)
coalesce({{name}}, {{companyname}})
In the example: If name has a value, return name, else return companyname