Expose Linked Record Positions

Let’s say you have 2 tables within a single base: Department and People.

Next, pretend you create a single new record in the Department table and link 3 People records: Alice, Bob, and Chris.

So the “People” column in the Department table contains the record links and we “Allow linking to multiple records” option enabled.

This column also records the order of the People records linked, where the records are positioned in the order of: Alice (first), Bob (second), Chris (third).

Next, I’d like to create a VIEW in the People table that shows this corresponding position for these people for this Department.

That way, if someone re-orders the linked People to be (hypothetically): Bob (first), Alice (second), and Chris (third) – then this VIEW in the People table would automatically re-order those records, accordingly.

The problem is that I don’t think there’s a way to expose Linked Record positional information automatically through any sort of Lookup.

Depending on the structure of the data, it is possible to use rollup and formula fields to calculate record link position. Create a unique identifier for each linked record. In the parent record, have a rollup field of this unique identifier. Pass the list of all linked records back to the child table in a rollup, and have the child record calculate its position in the list. The exact formulas for the rollups depend on the unique identifier. The easiest method is when the unique identifier is always a set number of digits.

I get your approach, but the biggest issue is one of usability. Using my original example, if I were to add a new Number column to the People table called “Rank”, I could define values like:


Name | Rank
Alice | 1
Bob | 2
Chris | 3

In this scenario, though, there’s no way for me to enforce this record ordering within the Linked Records “People” column in the Department table. A user could easily drag/reorder those linked items and that would not be kept in sync with the Rank values.

Therefore, I think the problem still stands. That said, let me know if I’m missing something else here.

I may have misinterpreted your situation.

I am suggesting using rollups to determine the position of the record in the linked field. When users re-arrange the linked records in the linked record field, the rollups would recalculate. Users could not reorder the linked record fields by arranging the records in a view.

If you want the linked records to be re-ordered according to a view, that can be accomplished with a button script. I have written scripts for clients that accomplish different variations of this. This cannot be done automatically with a automation because rearranging the order of records in a view does not actually change any data in the records. Trying to automate this is further complicated by the fact that records can appear in different orders in different views. Thus, this product suggestion is unlikely to be implemented.

Thanks for the inspiration! I think I get it. I’ve attached an example base that I think captures what you’re describing, here.

Essentially, the steps were:

  1. Create a “People Names” Rollup in the Department table, that’s effectively an ARRAYJOIN{values} formula.

  2. Expose this rollup within the People table as “Department Names” column.

  3. Create a “Rank” column in the People table that uses the following formula:
    SEARCH({Name},ARRAYJOIN({Department Members}))

The relative position of the person’s name indicates their relative rank.

Note: This assumes every person’s name is unique and no duplicates exist.

Actually, one way to improve this would be to expose the RECORD_ID() for each People record, and then use those values in the SEARCH() formula… this is because we are guaranteed that every RECORD_ID() field is considered globally unique (with no chance of duplicates).

1 Like

I’ve updated my example base to use/reflect RECORD_ID() values, which will properly handle people that have duplicate names.