Getting Airtable Search Records to work in a sub-scenario without a unique identifier

:bullseye: What is your goal?

Hi guys, I’ve been trying to update a specific airtable record reliably, but I can’t find a concrete way to search for it. I’m sure there’s a simple fix to this, but at this point my brain is frazzled.

For context, I have a “Dispatcher” scenario with a webhook trigger from Funnelish. After the webhook, there’s a router that fires into 1 of 3 subscenarios based on the name in the Product array. If someone buys everything in the funnel, the dispatcher will fire 3 times, triggering each subscenario respectively.

The Airtable record is created in the subscenario that’s triggered when the core product is purchased. It must be updated in the other 2 subscenarios if they’re triggered.

:thinking: What is the problem & what have you tried?

Problem is I don’t have a reliable way to search for the record that was created.

I can’t use Order ID since each order number is different for each item purchased in the funnel. Same can be said for Order Time.

I can’t use Bundle ID since that appears to be a “Customer ID” which doesn’t change if the same email orders. It’s not unique so repeat entries would cause chaos.

Right now, I’m using this formula in the airtable search records module:

AND(
{Customer ID} = “{{54.Bundle_ID}}”,
ABS(DATETIME_DIFF(“{{54.Order_Time}}”, {OrderTime}, ‘minutes’)) <= 45
)

But this isn’t bulletproof. Because if someone goes through my funnel and buys everything twice within say 15 mins, airtable does not know which record to update.

Hopefully that made at least some sense…?

Hey Oliver,

have the subscenario return output to the main scenario when the run completes, then store it in a variable.

Then before each subscenario is called→ check if the variable has a value, and if it does, send it as input to the subscenario to use for updating the record instead of creating a new one.

Then in each subscenario → check if there was a record ID received as input. If there was → update the record; if there wasn’t → create a new one. If it created a new one → return the ID to the main scenario.

1 Like

Hey Stoyan_Vatov,

Appreciate the reply. I can’t see that working though because the dispatch scenario fires for each item purchased in the funnel, and there’ll be a bunch of them running at once.

Yes it will, if you tell the module to wait for output:

1 Like