Help

Catch user ID in webhook tiggered by a Button

2942 6
cancel
Showing results for 
Search instead for 
Did you mean: 
Anna_Marie_Wats
6 - Interface Innovator
6 - Interface Innovator

Hello,

I have a table for keeping track of our product demos that our sales team uses. I created a button that triggers a webhook in zapier and provides all of the information such as: The demo, the current employee who has the demo, their email, etc. 

When the webhook is triggered it sends an email to the last current user of the demo that their demo is being requested, but I cannot seem to figure out how I can catch the information of the user that is clicking the "request demo" button.  

Also, our sales team uses a shared view of the demo page and it has a domain access restriction, so I know that in order for them to view the table, they have to log in using their work email.

 

Any solutions to catching this information would be greatly appreciated. It was a big win to figure out how to get the email sent notifying the salesman that the demo is being requested, but its pretty pointless if they do not know who is the person requesting it.

6 Replies 6

Switch it from a button to a single-select field, and then you'll be able to see who modified it in another "modified by" field that you would need to create. But you'll likely need to trigger the webhook through a script, which I describe here.

p.s. I would strongly recommend migrating from Zapier to Make, which is significantly cheaper than Zapier but infinitely more powerful & more customizable & more user-friendly than Zapier. I give some good Make training tips here.

You could use the session function in a script to access the button clicker's Airtable ID, email, and name?

And you could then use that with your Zapier webhook like this:

 

await fetch(`https://hooks.zapier.com/hooks/catch/12731796/34rdrnn?email=${session.currentUser.email}&name=${session.currentUser.name}`);

 

Which results in this on Zapier:

Screenshot 2023-05-03 at 3.32.25 PM.png

Here's a link to the base

That sounds like it could work for me, I just have to make sure it also pulls in the other field data from the record the button was clicked for.

Also, I am not that familiar with scripting so I would need the script already built and instructions on where to make changes within the script. 

I was also given the solution to build a script with the layout below, but I am unsure how to actually build it.
What the script will look like:

  • Define the table and fields then retrieve the specific field values to put into the script
  • Utilize the textAsync() method to request users to enter their email or whichever user information that you require
  • Format the webhook call URL with the values from the fields and the user-inputted information
  • Use the fetch() method to send out the webhook call

 

Hmm, how are you triggering the Zapier webhook now?  Is it via a button field opens a specific URL that you've created that has all the details?  If so, it's a pretty small thing to add the session email in there and if you provide access to an example base I can set it up for you and you can port it over to your main base if you'd like

I don't think you'd need to use textAsync() if the session functionality works the way you want, and we shouldn't need to format the URL much if you've already got the setup I mentioned above done

Hi @Anna_Marie_Wats,

I believe that you may be over-engineering the solution, plus making things a little less user-friendly for your users because you’re making them open up either a scripting extension dashboard or an extra tab in their web browser that they will need to close.

As I mentioned above, you can easily & quickly solve this by using a single-select field instead of a button, because Airtable will automatically give you the person who modified that field.

Then, if you want to use the very simple script that I already wrote for you, simply send that record ID to a webhook in Make (or a webhook in Zapier, which is less capable & more expensive than Make).

Then, Make or Zapier can pull in all the data from your Airtable record. (Although you wouldn’t even need to use a script at all if you want Zapier or Make to poll for changes on a regular schedule.).

With this method, there is no complicated scripting required, no extension dashboards opening up, and no extra browser tabs opening up.

You can even change the value of the single-select field after the automation runs, to let the user know the results of their actions.

p.s. If you have a budget for your project and you’d like to hire an expert Airtable consultant to help you set this up, please feel free to contact me through my website: Airtable consulting — ScottWorld.