Best answer

Can an Action also know which Trigger it was paired with?

  • 27 February 2020
  • 7 replies
  • 264 views

Userlevel 3

Hello Zapier community! Is it possible to implement an Action that knows which Trigger it was used with?

For example, if someone wanted to make a Zap triggered by uploading to their Instagram account, I'd like to trigger an action that knows it was Instagram as opposed to, say, Pinterest. It's not enough to guess based on the URL because the trigger could also be GMail or Slack, where people can put URLs that could look like anything.

We'd like to be able to track not only that the requests are coming from Zapier, but where in Zapier is it coming from specifically, without needing to bother the user by asking them to manually input which trigger they used. Is this possible?

Thank you once again!


icon

Best answer by AndrewJDavison_Luhhu 28 February 2020, 08:42

View original

This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

7 replies

Userlevel 7
Badge +10

Hi @Rene

What's the action step in this case?


Userlevel 3

Hi @AndrewJDavison_Luhhu!

The action is to take the photo URL that was supplied by the trigger and forward it to our API along with other data. Our backend will then take that URL and display it on a digital picture frame.

So imagine having a digital picture frame, and having a zap linking Pinterest and our app. You pin something on Pinterest, and that shows up in your frame. The trigger is Pinterest, the action causes the pinned photo to show up on your frame, and the goal is to figure out from our backend that the trigger was Pinterest (and not Facebook, Instagram, GMail, etc).

More specifically, the action requires two things: an ID that references a playlist (we have an app where users can sort photos into playlists, which in turn can be played in frames, and each playlist has an ID), and a photo URL. It then forwards those to an API which does the work of pushing the image onto the frames. We already have an action that can take both of these inputs, as well as the backend that can support it, and they already work as I described above, though our app is not yet published on Zapier.

So I'm looking for a way to add a third input, a way to figure out which trigger a zap might use so that we can know where these photos are coming from.

I hope that answered your question well enough! Looking forward to your insight :)


Userlevel 7
Badge +10

Hi @Rene

The easiest approach here would be to adjust your API to accept an addtional field like "source"

You can then hardcode the value into your 4 respective zaps.

The Facebook triggered zap would send 'source="Facebook"' etc...


Userlevel 3

Hi @AndrewJDavison_Luhhu

Thanks for the suggestion! But wouldn't hardcoding the values mean there will be one action for each trigger that people might use? So we'd need to create many actions to support many triggers?

Also, with this strategy, how can we prevent a user from mistakenly choosing the wrong trigger (eg, use a Pinterest trigger for an Instagram action)?

Thanks for your help and hoping to hear your thoughts on this! 😃


Userlevel 3

I also forgot to specify, in case it wasn't clear, that we're creating an app and will be publishing it on Zapier. We don't have zaps, but rather the idea is to allow anyone to create zaps to integrate with our platform.

So the question is, given that anyone can pair any trigger with any action, how can our action know which trigger was used with it?


Userlevel 7
Badge +10

Hi @Rene

I get you now! In that case, you'd need to have a dropdown in your action step where people could manually select the source - there wouldn't be a way to automatically detect it.


Userlevel 3

Thanks @AndrewJDavison_Luhhu. That does seem to be the only way.