Help

Automation (does this need a script?)

Topic Labels: Automations
Solved
Jump to Solution
1118 3
cancel
Showing results for 
Search instead for 
Did you mean: 
Melagence
5 - Automation Enthusiast
5 - Automation Enthusiast

Hi there,

i have an automation question that I can't get around. Using Airtable as a CRM system, I have a table DEALS, a a table CLIENTS and a table BRANDS. I would like to build an automation that checks on a new DEAL if a CLIENT has placed a DEAL with that BRAND before. The DEAL name contains the name of the brand and all DEALS of the CLIENT are referenced in the CLIENTS table.

It needs to be something like:

Trigger: New Deal

If CLIENT(from DEAL) has already a DEAL that name contains the name of the BRAND (from DEALS) then set „NEW CLIENT“ field to TRUE

anyone that might be able to help me out here?

thx!!

2 Solutions

Accepted Solutions
kuovonne
18 - Pluto
18 - Pluto

Sounds like [DEALS] is a junction table between [CLIENTS] and [BRANDS].

Use the "Find records" action to find the number of records in the [DEALS] table where the client matches the triggering client, and the brand matches the triggering brand.

Then have a conditional group based on the number of records found. If only one record was found, it was the triggering record, and it is a new deal. Set {New Client} to true. If more than one record was found, it the client already had a deal with that brand.

Make sure that the {client} and {brand} are set for the {deal} before the automation gets triggers. Depending on how you create the record, this might be upon record creation or not until after record creation and the user fills in the fields.

See Solution in Thread

Alexey_Gusev
12 - Earth
12 - Earth

Hi,
Probably no script needed. Use Find Records with condition you described. If that ok, the rest is simple - add conditional action, in condition choose result of step 2 - length property. 'Already has' means that length of list will be >0. So, in action choose Update record and desired field/

See Solution in Thread

3 Replies 3
kuovonne
18 - Pluto
18 - Pluto

Sounds like [DEALS] is a junction table between [CLIENTS] and [BRANDS].

Use the "Find records" action to find the number of records in the [DEALS] table where the client matches the triggering client, and the brand matches the triggering brand.

Then have a conditional group based on the number of records found. If only one record was found, it was the triggering record, and it is a new deal. Set {New Client} to true. If more than one record was found, it the client already had a deal with that brand.

Make sure that the {client} and {brand} are set for the {deal} before the automation gets triggers. Depending on how you create the record, this might be upon record creation or not until after record creation and the user fills in the fields.

Alexey_Gusev
12 - Earth
12 - Earth

Hi,
Probably no script needed. Use Find Records with condition you described. If that ok, the rest is simple - add conditional action, in condition choose result of step 2 - length property. 'Already has' means that length of list will be >0. So, in action choose Update record and desired field/

Melagence
5 - Automation Enthusiast
5 - Automation Enthusiast

Great! both worked. I struggled a bit with the "find records" as it only works if i chose brand and client "id" instead of "name" in the conditions. But now it works as expected. 👍