Skip to main content
Solved

Fetching info from within a linked record


  • Participating Frequently
  • 8 replies

Hello, 

I am pretty new to airtable and have a slight issue with fetching info from a record within a record. 

With an automation i create a number of records within a record to be able to choose multiple products for the same order number. (Not a lot of context here, but it would be a way to long post if I provide all the context)

All I want to do is separate the info, in the following case, for the two elements.

Looks kind of like this:

Amount & product (linked records)Weight (lookup)

Weight, first element

(help here)

Weight, second element

(help here)

120 Coarse,

100 Fine

4.5, 3.04.53.0

 

Is there any way to fetch certain info depending on the position of the lookup element? 

 

Thank you! 

Best answer by TheTimeSavingCo


Try this out:

First:

LEFT( ARRAYJOIN({Number (from Table 2)}), FIND( ',', ARRAYJOIN({Number (from Table 2)}) ) - 1 )

Second:

SUBSTITUTE( ARRAYJOIN({Number (from Table 2)}), First & ",", "" )

 Link to base

View original
Did this topic help you find an answer to your question?

5 replies

TheTimeSavingCo
Forum|alt.badge.img+18


Try this out:

First:

LEFT( ARRAYJOIN({Number (from Table 2)}), FIND( ',', ARRAYJOIN({Number (from Table 2)}) ) - 1 )

Second:

SUBSTITUTE( ARRAYJOIN({Number (from Table 2)}), First & ",", "" )

 Link to base


  • Author
  • Participating Frequently
  • 8 replies
  • January 30, 2023
TheTimeSavingCo wrote:


Try this out:

First:

LEFT( ARRAYJOIN({Number (from Table 2)}), FIND( ',', ARRAYJOIN({Number (from Table 2)}) ) - 1 )

Second:

SUBSTITUTE( ARRAYJOIN({Number (from Table 2)}), First & ",", "" )

 Link to base


This worked like a charm! Thank you! 

I'm not sure I see a pattern here though. If there were a third and fourth linked record with a "number" each, how would this formula expand? 


TheTimeSavingCo
Forum|alt.badge.img+18
olausenn wrote:

This worked like a charm! Thank you! 

I'm not sure I see a pattern here though. If there were a third and fourth linked record with a "number" each, how would this formula expand? 


You'd keep nesting them, so something like this:

SUBSTITUTE( SUBSTITUTE( ARRAYJOIN({Number (from Table 2)}), Second & ",", "" ), First & ",", "" )

  • Author
  • Participating Frequently
  • 8 replies
  • January 31, 2023
TheTimeSavingCo wrote:

You'd keep nesting them, so something like this:

SUBSTITUTE( SUBSTITUTE( ARRAYJOIN({Number (from Table 2)}), Second & ",", "" ), First & ",", "" )

That didn't really work, it actually fetched all elements except the first one. 

Are you able to see where this goes wrong? 

I copied your code and substituted the names "number from table 2", "second", and "first". 

 


  • Author
  • Participating Frequently
  • 8 replies
  • February 3, 2023

If someone ever reads this and is wondering, I made it work by brute force. 

The code above had a few flaws when the number of elements exceeded 2. 

To get around this I had to create a field for every time en element was grabbed since the code for "second" above retrieved all elements except the first one. Then I used the code for "first" above on that new field and so on. Works fine, but you have to add "," at the end for the "find"-formula to work. 

 


Reply