This article demonstrates how to represent the data uniformly in the formula mode when multiple rows are involved.
What you'll need:
Skill level: Medium
Time required: 6 minutes
- Basic knowledge of JavaScript or good copy-paste skills
Formatting with multiple rows of data for messaging platforms
You can click the following preview to watch a video of this article or continue with the guided walk-through:
At times, you might end up dealing with multiple rows of data that you wish to send across a messaging platform of your choice. However, using a Foreach loop to loop over your rows of data may not be feasible as it leads to sending multiple messages to the customer. Moreover, the data looks pretty much unreadable in such a case. For example:

Instead of something like this:

map()
function. The map()
function converts the rows of data into a single string. This single string would appear as joined by newlines so that each row appears in a new line:
This map()
function in Formula mode loops over each record (a Google Sheet in this case) and creates a string that is appended by \n
. The \n
tag is equivalent to a new line. You can copy and paste the following formula with a data pill of your choice:
[YOUR DATA PILL].map(car => {
return "*" + car.brand + "*" + " " + car.cost;
}).join("\n")
[YOUR DATA PILL]
with your actual data source that contains multiple rows of data for which you want to achieve the expected results.
Comments
0 comments
Please sign in to leave a comment.