How to control if a "user id" exists in a row

(Boite Zero) #1

Hi guys!

At the start of a flow, I need to control if a “user id” already exists in a Google worksheet when a user comes for the second time and more.
=> If “user id” doesn’t exist, user id is added automatically (add a row) and other columns can be filled by the user (update row)
=> If not, there is no new row for this “user id”.

Thanks :slight_smile:

(Nathan Stults) #2

Hi, thanks for posting.

I’m not sure I fully understand what your question is though. You can use a Get a Row method from the Google Sheets integration (don’t specify a Row ID, instead select the name of the column that has your User ID in it and in the value set the User Id from the trigger).

If that method returns nothing (i.e. you can filter on the resulting Row ID being empty) then the user doesn’t exist, and you can add them. If the Row ID is not empty from your Get a Row method, then the user already existed.


(Boite Zero) #3

Hi Nathan,
I tested the get row method as explained, but the value entered in the “value” field of the trigger does not work. It works if I put the user id like eg 3lkjZ94wY. Alas, we can not ask the user to type this code when he comes back to work with the bot? I need the bot to recognize the user automatically.
Thanks again for your help :slightly_smiling_face:

(Nathan Stults) #4

Can you be more specific about what does not work? Is {{trigger.user_id}} showing empty? Or is it changing from one run to the next?