Help

Re: Formula to populate text in another field if a dropdown is selected

395 1
cancel
Showing results for 
Search instead for 
Did you mean: 
Nicko54
5 - Automation Enthusiast
5 - Automation Enthusiast

Hi all, 

I am creating a resource library and I want different info to be displayed in one field based on the selection in another field. 

Im sure I am over thinking this and there is an easy solution! 

Here is the example; 

My base is displayed in a gallery view. 

Based on the 'Provider' listed, I want the description to change relevant to the 'Name' (e.g. Online Learning platforms'). If more than 1 'Provider' is listed, I want info for both to be displayed.  

Nicko54_1-1723162574878.png

Is there an easy solution for this? or a workaround? 

Many thanks! 

Nick  

 

 

5 Replies 5
Breakneckbrands
6 - Interface Innovator
6 - Interface Innovator

There are a few different ways to skin this cat!

To display different information based on the provider selected, you can create a separate table for your providers where each provider has its own description. Then, in your main table, link to this provider table so you can select one or more providers. Once you've done that, you can use a lookup field to pull in the relevant descriptions based on the selected providers. Finally, if you want to combine all the descriptions into one field, you can use a simple formula to do that. This way, in your gallery view, the description field will automatically update to show the correct information for the selected providers.

Here’s how you can set it up:

Step 1: Create a Table for Providers
Create a new table for your providers (if you haven't already). This table should include:
A "Provider" field (Single select or Single line text).
A "Description" field (Long text or Single line text) where you can enter the specific information for each provider.

Step 2: Set Up the Main Table
In your main table (the one where you have the 'Name' field), create a Linked Record field that links to the Providers table. This will allow you to select one or more providers.

Create a Lookup Field in the main table that looks up the "Description" field from the Providers table. This will bring in the relevant description(s) based on the selected provider(s).

Step 3: Combine Descriptions
If you want to combine the descriptions into a single field, you can use a Formula Field. The formula would look something like this:

ARRAYJOIN({Lookup Field}, ", ")

This formula will concatenate the descriptions for all selected providers into a single text string, separated by commas.

Step 4: Display in Gallery View
In the gallery view, you can now display the formula field that contains the concatenated descriptions. This will dynamically update based on the selected provider(s).

Example Setup
Providers Table:
Provider: "Udemy"
Description: "Online courses on various topics."
Provider: "Coursera"
Description: "Online courses from universities."

Main Table:
Name: "Online Learning Resources"
Provider (Linked Record): "Udemy, Coursera"
Description (Lookup Field): "Online courses on various topics., Online courses from universities."
Combined Description (Formula Field): "Online courses on various topics., Online courses from universities."

@Breakneckbrandssolution is how I'd go about it as well as it's a lot easier to maintain.  If you really want to use a formula you can use a `SWITCH()`: https://support.airtable.com/docs/formula-field-reference

Awesome! thank you! one question - the description for each Provider changes depending on the {Name} field. 

So if the Provider is CompanyA and the Name field is 'Online learning platform' the description is xxx

but if it is a different Name field changes eg 'Marketing templates', and the company stays the same, the description will be different. 

The Name field represents different products. 

So if this was my new Providers Table, can the formula lookup the company (e.g. CompanyA), and lookup the Name (e.g. Online learning platform), then pull through the unique description?

Nicko54_0-1723174704851.png

I hope that makes sense!

 

 

 

 

Nicko54
5 - Automation Enthusiast
5 - Automation Enthusiast

Nope, it'd all be hardcoded within the SWITCH() formula itself!