How to insert line breaks when entering text
When automating text entry into text fields, standard line breaks sometimes cannot be used. Why?
When you press 'Return' to create a line break in the axiom "Enter text" field, this is translated as a return key press to the bot, too. But sometimes, pressing the 'Return' key does not translate into adding a line break on a website. Sometimes nothing happens, because the text field you are using does not support the use of the 'Return' key at all; sometimes, particularly when writing DMs, the message may be sent instead of a line break being entered.
For example, when automating a DM in Instagram, pressing 'Return' would send the message instead of inserting a line break as expected. Luckily, there is a workaround. This guide shows you how to insert line breaks when using the 'Enter text' step to automate data entry into text fields. This guide assumes you have already set up an automation using the 'Enter text' step.
The example below demonstrates how to insert line breaks in DMs being automated on Instagram, but the same method can be applied to any text input. We use the 'Custom line break' setting in the step to achieve our goal.
# Open the 'Enter text' step where you wish to insert line breaks
Within the step, locate the 'Custom line break' setting. We will use this setting to add our line breaks.
- Custom line break - Toggle the setting to 'On'.
- Record - Click and record a unique sequence of characters to use instead of standard line breaks.
- Text - Edit your text and use the recorded sequence to insert line breaks. In this example, we use '⇧ + ⏎'. Be sure to remove any white space.
# Inserting line breaks when passing data from a Google Sheet
You can use the same method to add line breaks when passing text from a Google Sheet. However, when testing the solution, I found that '⇧ + ⏎' caused an unintended action: the selected cell would change when '⇧ + ⏎' was pressed to insert the line breaks. To resolve this, I changed the recorded sequence to '⌥ + ⏎'.
- Custom line break - Toggle the setting to 'On'.
- Record - Click and record a unique sequence of characters to use instead of standard line breaks.
- Google Sheet - Edit your text in the Google Sheet and use the recorded sequence to insert line breaks. In this example, we use '⌥ + ⏎'. Be sure to remove any white space.
# The end result
Below, you can see the line breaks inserted into the text using the method outlined above.
# Wrapping up
You might expect line breaks to work as you type them in your text, but in browser automation, it's a bit more complex. However, we provide a simple workaround that can be applied in the step or a Google Sheet within seconds. Note that varying unintended actions may occur, so you might need to try different recorded key sequences than those shown in this guide.