Creating a cycle using Google Sheets data

#1

Dear all.
I’d appreciate some help with creating a loop in my flow that uses new Google Sheets data each time it restarts.

It’s a flow for the Telegram bot which suppose to guide the user through a series of steps.
The idea is: the user gets an image and a button underneath that photo (created through the custom keyboard option in Telegram messages). When the User taps the button, the message on the button changes and a new image is sent, also with the button underneath, and then the process repeats. Data for this process are stored in Google Sheets, each row contains data on the image, original button text and button text after tapping (17 rows).

As the same step is repeated 17 times, I don’t want to build it manually. Instead, I would like to turn it into a loop that will pick up data from the next Google Sheet row each time it goes back. Tapping the button under the picture should trigger sending a new image from the sequence using the same 3 actions:

  1. Send a Photo (Telegram Actions)
  2. Wait for the Response
  3. Edit Message Keyboard (Telegram Actions)

And here is the problem: I can’t figure out how to make it pick up a new row each time and consequently go through all the data. Label and Go to Label only repeat the same loop over and over.

Can someone please tell me what I miss here? Should I add something else to this cycle?

Many thanks.
Maria.

#2

UPD: solved this somehow with the help of [the Loop Example ](http://flowxo.com 16)
and advice from here to have a column with numbers and set a counter.

If someone needs help with similar problem, my loop looks like that:

  1. Set an Attribute (counter starting with 1)
  2. Label
  3. Get an Attribute
  4. Get a Row, using mentioned Column with the numbers and Value of the Attribute
  5. Send a Photo, using all the variables from Get a Raw
  6. Wait for Response
  7. Edit Message Keyboard.
  8. Sen an Attribute (increment a counter +1)
  9. Go to label with the filter attribute = less than 17, according to the number of the rows.

I got another problem now. My loop stops before the last iteration and gives me the message
‘The maximum number of runs for this action has been reached’ even though it hasn’t (still less than 17, as in my condition and less than 20). What could possibly cause this problem?

1 Like
(Nathan Stults) #3

Hi,

You are reaching the limits of the free plan. On the free plan, the maximum loops is limited to 15 in a single flow. This limitation does not exist in paid plans.

1 Like
#4

Thank you, Nathan!
Now that makes sense!
Didn’t this info anywhere else in the Guides