Write magic repeat output as separate rows in Google sheets

#1

I am sending a post request to a service that is providing mutiple data points for a specific call. For example name: John, Bob, Roy. I can return all the data points to single cell in Google sheet using the magic repeat function but, i want each of the points in its own Cell.

How could I add he data ouput to separate cells?

#2

Btw, the number if data points varies.

(Karen Barker) #3

Hi there,

Unfortunately you wouldn’t be able to use the magic repeat for this - as you’ve seen this gives you all the results in 1 cell.

The only way to be able to add multiple rows would be to create a new add row for each data point. You’ve said the number of these varies, do you know what an absolute maximum would be?

If you know a maximum you could add that number of add a row actions. Use the {{ output 1 }} notation to add the corresponding data point to the row and add a filter on the action stating if {{ output 1 }} is not empty.

Hope this helps. :slight_smile:

(John Lutz) #4

I figured out how I could do this if you can show me a script that I could use in a replace task to find and replace the first comma and only the first comma of a string.

John Lutz
806.576.3905

(John Jackson) #5

This might work John, if you enable the regex option on Text (String) > Replace Text method:

/^,/

Should remove the comma if it is the first character in the string?

#6

I need a script that looks at the string and replaces the first comma, The first only.

Can you show me how to do this with an example?

(Daniel Beckett) #7

Hi JL,

Just to clarify, when you say that you want to replace the first comma is that comma going to be at a random point in the string or at the start?

The example John showed will work if the comma is at the start of the string and would be setup using the below regex in a Text (String) > Replace action:

(John Lutz) #8

I got it, thanks.

John Lutz
806.576.3905