Skip to main content

Hey everyone,


I created a promo code randomizer that works well—until multiple users click the button at the same time. In that case, the bot sends the same promo code to two different users. Then, in the Google Sheet, it updates the username incorrectly. As a result, when the next person clicks the button, the bot skips a column and sends the following promo code instead.

For example, at 11:24, if two users click the "Get Promo" button at the same time, both will receive promo code #4. Then, at 11:25, when another user clicks the button, they’ll receive promo code #6 instead of #5.

You can see the issue in the attached screenshot. I've also attached the bot flow for reference.

 


@Grigor change the order of your logic.

Increment the counter FIRST, then set a user field with the bot field’s value, and then do the Google Sheets actions.

Changing the order will make sure the error you’re having won’t happen anymore.


@Gustavo Boregio  hello. Thanks for the reply. 

As I understand your instructions correctly, I followed them, but unfortunately the same error still occurs. Please see the attached screenshots of the flow and the issue.

As you can see, it skipped row 7, sent the promo code from row 8 to two different users, and recorded only one Telegram username for it.

 


 


@Grigor you forgot this part:

then set a user field with the bot field’s value.

Make sure to add this in your first action step - so each user will have a USER FIELD with the ID that corresponds to them.

This takes a ‘snapshot’ and avoids any issues you’re having with delays in the Google Sheets actions.


Dear ​@Gustavo Boregio , thanks for the help. But I am having the same problem again. 

 


@Grigor on the Google Sheets actions, make sure you’re using the counter ‘Promo_Field_1’ to search for the ID, and not the bot field.

If that’s how you’re doing it, then there’s something weird going on with your setup.

If you need, I can jump on a (paid) troubleshooting call so we can find the root of the issue and help you fix it. You can book the call at https://gusboregio.com ;)


@Gustavo Boregio thanks, I did that way 

 


Make Bot_Count a User Field, not a bot field.

 


Reply