Sending users their purchase receipt

(Khashayar) #1

Hey, I’m stuck on this problem for some time and wanted to see if there’s any work-around.

My users purchase things through a Typeform. I send them to the form with their Facebook ID as their Hidden Variable. I have it set-up so that I collect the answers and the user_ID in a new Sheets row (using Zapier since your Typeform integration doesn’t support Hidden Variables). This way I know who answered what.

Now I want to send a receipt to the person who filled the form.

As mentioned here before, I do Sheet Row trigger to Webhook (with JSON Data being all the answers and the user ID of the person who filled the form), trigger a Broadcast flow, and then Make a Custom Request.

Now, if I run this, all my users get this person’s receipt. I want to filter the Webhook trigger flow by the user ID that I have received from the Sheets row but I can’t, since you can’t have an output on the right side of the filter.

Ideally I’d say:
Trigger this flow when UserID of this flow equals UserID of the Sheets row, as pulled from the JSON of the previous flow.

A workaround that I’m using for another flow is the Code action and comparing variables using Javascript. And tbh I could use the same method here but it’d destroy my number of triggers on my account.

I could say: receive webhook > Code (is User ID of this trigger the same as User ID of the Sheets Row from previous flow) > Make Custom Request (filter it to only run if the result of Code is TRUE)

This would work but since I’m not filtering the trigger itself, the whole flow would be triggered for all my users, even though all but one of them would not get the receipt.

So every time one user buys something, I’d have to waste something like 400 interactions to send them a confirmation.

Am I understanding this right? Can you think of any workarounds? Also, any idea when filtering with previous outputs will become available?

Cheers!

(John Jackson) #2

I don’t think you’re going about this the right way actually. In fact, as long as you know the user’s response path (or at least their FB messenger scoped user ID), you can send a message to that user in any flow. It doesn’t have to be a broadcast flow, and in fact, this doesn’t need a broadcast, as you’re only messaging one user.

If you have the user’s Flow XO response path in the Typeform hidden field and therefore in the new row that’s added to Google Sheets, you can simply use a ‘Google Sheets > New Row’ trigger, and then use a ‘Bot > Make a Custom Request’ next to send the receipt by clicking the pencil icon on the Response Path field and selecting the output from Google Sheets that contains the response path.

If you only have their Facebook Messenger scoped user ID in the sheet (not the full response path), you’ll notice response paths are always in the format {bot_id}/c/{user_id}. The {bot_id} part is always the same for any message sent/received through the same Flow XO bot. So you can get that by sending a message to yourself and you’ll see it in the logs.

I hope that gets you on the right path, I really think this is a lot easier than you thought, unless I’m missing something!

2 Likes
(Khashayar) #3

OHWOW! Now I understand what Response Path is! Amazing!

Everyday I appreciate your platform more and more! Thanks for making the time to answer all these questions with detail.

I think you should add a page about Response Path to your documentations. I just ignored the functionality since I couldn’t figure out what it did!

Thanks again

1 Like
(John Jackson) #4

No problem!

Glad you like the platform. Yes you’re right about docs for response path, and docs in general. We’ll be making improvements in the future.