How to remove line breaks in empty expression?

Describe the problem/error/question

How do I remove line breaks in empty expressions? I’m using a conditional operator so if the value is empty it’ll display as blank but it doesn’t remove the line break. How can I fix this so it looks like this:

Producer: CyberAgent
Studio: EMT Squared

I don’t want it to look like this:

Producer: CyberAgent

Studio: EMT Squared

What is the error message (if any)?

Please share your workflow

Share the output returned by the last node

Information on your n8n setup

  • **n8n version:1.92.2
  • **Database (default: SQLite):default
  • **n8n EXECUTIONS_PROCESS setting (default: own, main):own
  • **Running n8n via (Docker, npm, n8n cloud, desktop app):npm
  • **Operating system:Windows Server 2022

You can try this version

Producer: {{ $json.producer }}
{{ $json.licensor ?  'Licensors: ' + $json.licensor + '\n' : ''}}Studio: {{ $json.studio }}

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.