Making Predictions in Zapier
Build AI-powered automations with no code.
Function provides a Zapier integration for adding AI predictions to your automations. Let's build a Zapier automation that listens for submissions to a Google form, then generates an image and emails the respondent.
Adding the Form Trigger
First, create a form on Google Forms ↗ with two text fields:
- Email. We will use this to email the user with the generated image.
- Prompt. We will use this to generate an image using Stable Diffusion.
Here's the form with the two fields listed above.
Stable Diffusion predictor which we'll be using to generate an image.
Next, head over to Zapier ↗ and create a new zap. Add a Google Forms trigger by logging in to Google and connecting the form you just created:
INCOMPLETE: User must fill in their form to generate a sample response to be used in Zapier.
Logging in to Function
First, add a Function action:
You'll need to login to your Function account. Head over to your Account ↗ page on Function to generate a new access key for Zapier:
Then in Zapier, click on "Connect a new account" then enter your access key:
Making Predictions
Now, we're all set to make predictions in Zapier. In the Function action, choose the "Predict" event then set the predictor tag:
# Set the predictor `tag`` in the `Predict` action in Zapier
@samplefxn/stable-diffusion
Once you do, Zapier will automatically fetch the input values accepted by the predictor. Simply pass in the user's prompt from their response in Google Forms:
Using the Automation
A simple way to complete the automation is to send an email with the prediction result. You can add a Gmail action that sends an email. First, set the body type to html
then populate the body:
<p>
Hey there! Here is the image you generated by filling out the Zapier + Function AI Form:
</p>
<img src="<Place the prediction result data here>" />
After publishing the zap, fill out your form:
And in a few moments, you should receive an email: