Send a message to user when a GoogleSheet row is updated

(Lucianogenova) #1

Hi everyone.
I have a GoogleSheet where I successfully store table reservations, adding new row for each order.

As you can see I have different columns, which I fill with data collected from the users:
FB USER ID | USER NAME | …|PHONE NUMBER|

and the last one, “CONFIRMED RESERVATION”, which is blank until I’ll write something inside.

I’m going crazy from days trying to do a flow like this:

  • IF an exsisting row is updated by me (I write “OK” in the “CONFIRMED RESERVATION” column)
  • THEN the Bot sends a message to the relative user “FB USER ID” saying “Ok, reserved!”.
  • ELSE
  • IF I write “KO” in the “CONFIRMED RESERVATION” column
  • THEN the Bot sends a message to the relative user “FB USER ID” saying “Sorry, I can’t reserve for that day!”.

I made flow1 here
where I listen to updates made in a googlesheet row

and made flow2 here.
where I receive the webhook
then I Search Row
and finally send message “Ok, reserved!” or “Sorry, I can’t reserve for that day!” accordingly to the value contained in the “CONFIRMED RESERVATION” column.

By now all my users receive the “Ok, reserved” message, even the ones without the “OK” value in the “CONFIRMED RESERVATION” column.

Please… help me

Thanks in advance, Luciano - Italy.

(Daniel Beckett) #2

Hi Luciano,

You should be able to achieve what you need in one flow. When you use the updated row trigger in Google Sheets it pulls through all of that row’s data. You can use this in your following actions - the response path for example in a Bot > Send a Message action.

To set a custom response path you need to click on the pencil icon in your send a message action.

You can then use the ‘xo’ icon to set the response path as the value from your row

To control whether your users see the reservation confirmed or unavailable messages you will need to use Filters. A filter can check if the confirmed reservation column equals OK or KO and then the appropriate message can be sent to the user.

Hopefully that helps. If you still find that you have trouble getting your bot to work please feel free to email support@flowxo.com and we’ll be able to assist from there.

Thanks,
Dan

(Lucianogenova) #3

I’m sorry, so sorry to disturb you…
but I can’t get it working.

In your answer you say:
“You can then use the ‘xo’ icon to set the response path as the value from
your row”

and the image shows you wrote: {{update_response.path}}

but I can’t see this in my variables inside of aggiorna_riga method (the
name of the updated_row trigger).

Instead, I see theese:

Would you be so patient to help me once again?

I tried copying yours exact test: {{update_response.path}} but it fails
I tried {{aggiorna_riga.Content}} but it fails.
I tried {{aggiorna_riga.Updated}} but it fails.

I share with you my flow, in case you could take a minute to check it…
https://flowxo.com/share/k7any9d6

THANKS A LOT, really…

Sorry for the disturb…

(Daniel Beckett) #4

Hi Luciano,

It’s no trouble at all. Happy to help :slight_smile:

I forgot to check whether you are capturing the response path into your Google Sheet. If not, then you will need an additional column for response path so that you can save it against each user.

If you had a new message trigger then the response path variable would look something like this in the menu:

(Lucianogenova) #5

Hi Daniel, now it works. Thank you, so much.
If you have the time, could you explain me the logic of this?

Let’s see if I’ve understood:
with name, day, hour, etc. I have to catch another value, the response path, corresponding to the new row’s identifier of the GoogleSheet.
Then, with the trigger “Updated row”, every X minutes I check for updates in any rows.
If any updated is found, then I can send my message to the user in that row.

Is that correct? If yes, I couldn’t understand one thing.

Let’s say I give the user “A” a “KO” message, which corresponds to a Bot message saying “Sorry, we’re full.”

Few minutes later, another user (“B”) cancel his reservation, so now I could send the user “A” a news message like:
“Now we have a table for you, would you proceed?”
then I can take his revervation and transform his previous “KO” into an “OK”.
Everything’s ok here: he receives the confirmation message built for a confirmed reservation.

Now, my question: if I was wrong sending the user “A” this message, and I want to give him another “KO” (so this is the second time he has a “KO”…) this last message won’t be sent.
Is it because the cell already had a previous “KO” state, so this isn’t interpreted as an update?

I hope you could understand my HORRIBLE english: I hate uso Google Translator as I want to try speak english :wink:

Can’t say how much I’m grateful for your support.
Luciano

(Daniel Beckett) #6

Hi Luciano,

You’ve understood the logic perfectly there. Because the cell already had the value it isn’t detected as a change. If you want to get around this issue you could use a different value that you can update the row with in the event that you need to cancel a reservation again. So you’d have something like “OK”, “KO”, “RESERVED”

In your flow you could then filter a new message that checks for the “RESERVED” value and send the user a “Sorry, we’re full” message - or an alternative message depending on what you want.

Hopefully that clears things up? :slight_smile:

1 Like