How to create multiple conditional links?


#1

Hello everyone,

I’m new to Airtable, and although I’ve been looking to all templates and many forums, I have difficulties to create multiple conditional links.

Here is my example. Basically I have 2 tables :

My contacts (CONTACT Table) are looking for renting a apartment. In addition to basic information (Contact ID, Name, Email…) they have 3 search conditions :
- The district (District 1, District 2, District 3… District 20). They will be searching in several districts : District 2, District 5 and District 7 for example.
- The size (between SizeMin and SizeMax)
- The price (between PriceMin and PriceMax)
The apartments (APARTMENT Table) that are referenced. In addition to basic information (Apartment ID, Description, Photos…) they have 3 important attributes :
- The district where they are located (District 1 OR District 2 OR District 3… OR District 20). Only one value.
- Their size
- Their price

I would like to calculate a cell, for each contact, where I would find the list (or concatenation) of the matching apartments.

For now I could do it with only one condition, creating a junction table listing the districts (20 lines for District 1 to District 20), linking my CONTACT and APARTMENT tables to this DISTRICT table, and creating a Lookup field gathering the apartment IDs in the CONTACT table.

But how could I do it for matching with the 3 conditions ? Something like showing the Apartment IDs : Concatenate ( if (Apartment district matches with Contact districts) AND (Apartment size is included in Contact size search) AND (Apartment price is included in Contact price search) ) ?

Thank you for your help :slight_smile:

Philippe


#2

I think it’s better to use an “IF” inside another "IF"
In your example it would go IF(matches district, IF(matches size, yes, no), no)

I hope it helps


#3

Hi Klaus, thanks for your reply, but the problem is not there - maybe I wasn’t clear.

My purpose is to combine for one contact a list of apartments which meet some of the contact criteria. For one contact, the IFs system (or QUERY in Google Sheets), should then refer both to some fields in the CONTACT Table and in the APARTMENT Table.

But It look like it’s not possible with Airtable. The IF function can only refer to the same table fields. On another hand the Lookup type (that would be in the CONTACT Table, we would Lookup at APARTMENTs) cannot be conditional upon some of the CONTACT fields…

If anyone has a solution, that would be great. Thanks :relaxed:


#4

maybe you can create a “link to another table” field, then create a “lookup” field with the parameter that you want to use in the “IF” formula. those fields will have no function but to make your formula work, you can hide them later to keep your table “clean”.

I hope I helped this time