Creating email notifications each time a comment is added

Hi All,

I’ve set up a DM function on my app using comments.

Each user can create a DM with another and exchange messages via comments. This has been the easiest way for me to set up a DM.

Here’s how it works:

  1. User A clicks on a DM button on User B’s profile
  2. An inline list appears creating a DM between User A and User B
  3. In a Google sheet called “Chats” a row is added with the emails of User A (sender) and User B (receiver), as well as a unique Chat ID.
  4. Once in the chat, User A and User B can comment (message) each other
  5. A new row is added in the default Glide “Comments” Google sheet

Now for the problem:
I set up a vlookup, pulling the Chat ID and from Comments and using that to find the recipient of the DM (comment).
However, the vlookup only works when details are pre-populated. I.e. it doesn’t populate properly when new rows are added.

Does anyone have any tips?
I’d like to set it up such that each time a new DM (comment) is added, the person the DM is intended for gets a notification that they have a DM.
I have no problem setting up the email, but it’s the logic to get the email to the right person that’s tricky!

Are you using an add row action or a form to create new “comments”? Or is it the “comments” component in Glide Apps?

Comments component - that’s what I’m referring to by “default Glide Comments” sheet

Do you use a normal vlookup formula or have you looked at arrayformulas?

1 Like