Help

How can I use automation with Linked Records as a Dynamic condition in a Find Record step?

Topic Labels: Automations
574 7
cancel
Showing results for 
Search instead for 
Did you mean: 
0800-grizzly
7 - App Architect
7 - App Architect

Hi,

This question is a detail out from another question (here: https://community.airtable.com/t5/automations/dynamically-scalable-email-content-by-quot-tag-quot-in...), for reference.

I’m trying to abstractify our CRM’s mail setup using an automation with Find Record steps with Dynamic variables. One variable I need to use is “Tag” that links contacts to an area of interest (nature, sports, food, etc). Since I use the Tag classification in many places throughout the base (currently 8 tables), I have made it into a Linked Record instead of a separate Single Select for each table. Yes, I know that if I'd use Single Selects this would work without issues :).

The problem is I can’t figure out how to use a Linked Record as a Dynamic condition in a Find Record step. I’d like to search exactly so I choose Tag “is exactly” from the Dynamic conditions. Then I only find a “Make a new list of” option, under which I can choose the tag (“nature” in this pic).

0800grizzly_0-1731234175905.png

Testing this setup yields an error however, saying the filter value is invalid.

0800grizzly_1-1731234197107.png

If I choose another route and use “contains” in the Dynamic conditions (which I would like to avoid), I can’t get to choose any value for the Dynamic condition, because I “cannot assign list of string to a string".

 

0800grizzly_2-1731234239985.png

So, how can I use Linked Records as a Dynamic condition in a Find Record step? Or is it not doable?

Rgds,

Björn

 

7 Replies 7
FarioConsulting
6 - Interface Innovator
6 - Interface Innovator

Hi,
You could create a lookup or rollup field for the Tag classification within each table where you need to search records. As such, you'll have an intermediary field that contains the tag value (like "nature") which you could utilize as a lookup field as a dynamic condition in your Find Record steps

Hi @FarioConsulting,

Thanks for your reply. Unfortunately, it doesn't work the way I tested this with both Lookup and Rollup.

Here I try to assign a Lookup value to the Find Record step, but it gives me a "Cannot assign string to a string" error, so it behaves the same way in the Dynamic condition chooser as the straight Linked Record tag.

I couldn't find any other paths than go to "Field Values" and "Make a new list of..".

0800grizzly_0-1731323751703.png

Do I do something wrong here?

Rgds,

Björn

 

 

 

Hi,
Please clarify your goal. Static condition is when you want to find records, where Tag='nature' , for example
Dynamic - is like, when record updated (checkbox is ON  or description is changed etc), you want to find all records, where Tag = { the same tag as in updated record }
In your example, trigger is timed action. So, you have no source of dynamic variable.

Hi,

Thanks for looking at this. I should perhaps originally have commented that the timed action trigger is there only for safe testing. The trigger can differ, I don't think it is really relevant to the question.

In this setup I have two Find Record steps after each other. The first finds the contact to be mailed (in production this may well be a trigger step), and the second finds the mail template to be used given the "Tag" associated with the contact.

0800grizzly_0-1731437575595.png

Did that clarify?

Rgds,

Björn

 

The main problem is that step Find records designed to find a group of records, not a single record, so when you are trying to find a record and use field value, you get array of values instead. 
Of course, you can limit the number of records found to 1, but automation setup still consider it as array of records containing 1 element.
Array can be used to fill array values (like Linked field or multiselect) or to organize loop with Repeating group.
If you want to use dynamical result to make a compare in next steps, designed for a single value, you should start from single-record trigger, like Update record, then choose record or 'use suggested' to test and then try to use it in your automation.

I guess, other problem is when you will try using value of Linked records field, because it is array too. You can solve it by formula field with CONCATENATE({Linked field name}), so array will be converted to a string. 
But I think more clever solution is to use ID of 'nature' record in your Tags table instead of Linked field value. 
All records having tag 'nature' linked to this record. That means their Linked field must contain that record_id
Here is actual cell value of a linked field, array of 2 objects, each contains name and id of linked record (btw you can link by pasting this id)

Alexey_Gusev_0-1731465152200.png

 



The type of trigger is relevant because it defines a type of value to use in further steps. Timer can just give you a few points in time (previous run, next run etc), Find records returns array of records. When record updated/enters view/matches condition - returns a single record. When webhook received - anything you put in webhook call.

Alexey_Gusev_1-1731462065647.png

Another example, it might be close to your case, where you want to use data from some record in your operation :
I need to run special update for several objects in table once in a month (in the middle of it) and I have to distribute runs in time, so the update server will not consider it as DDoS attack. I'm using part of record_id and object id as random seed and chaotic math operation returns some number x (from 0 to 999), and with DATEADD (format('YYYY-MM-12', x*15, 'minutes'), I get random points in time. In this case trigger is When record matches condition 'Hours=0' or smth like that. and then if Last update perfomed in a current month, Hours to update become 'Up to date' till next month

Here, I'm using values from trigger record in further automation steps.


Alexey_Gusev_0-1731461445760.png

Alexey_Gusev_0-1731463709406.png

 





Hi @Alexey_Gusev thank you, and sorry for the slow responding. Have been reading and re-reading your answer, slow to digest :).

Now I see the relevance of the trigger, and because of the single record vs. array depending on trigger and Find Record also see why my testing fails. 

But then I didn't understand your workaround suggestions, using CONCATENATE or ID. How would I use these, would you have the time to elaborate a bit. And where do I find the console view in your picture?

Rgds,

Björn

Hi,
To use console, open scripting extension, take example 'Record picker',copy to window, insert your table name and field name(s) and add commands under comment //Customize....


Alexey_Gusev_0-1731984725868.png

In my example you can see contents of 'Contacts' field and 'concatenate'
The second field is formula CONCATENATE(Contacts)
As you can see, it's just a string
So when a record from this table present in trigger I can use dynamic value from field 'concatenate' in text comparisons.

Alexey_Gusev_0-1731985458318.png

Other way - when a record with 'nature' fires trigger, and I want to find in other table all records, linked to this 'nature' I just search for record ID in linked field

Alexey_Gusev_1-1731986218544.png

Alexey_Gusev_2-1731986266367.png