Linking AnyDB Cells to Other Record Cells
AnyDB Records can be connected to each in various ways to create relationships and link data together. This allows you to build complex data structures and workflows that reflect real-world relationships.
VIA DIRECT: Connect a cell value in one record to another
The simplest way to connect a record to another record is by using a formula to reference the value in another record.
To connect a cell value to another record, you can copy the reference of a the record from another cell and and paste it as a reference value in the cell you want. Then these two cells are connected and when the other cell value is updated, the cell with the reference value will also be updated.
To copy a reference value:
- Click on the cell you want to copy the reference from.
- Right Click to bring up the cell context menu and select Reference and then Absolute option.
- The cell reference will be copied to your clipboard.
- Go to the cell you want to connect to the copied reference.
- Type
=
and paste the copied reference value and press enter.
A cell reference looks similar to how Excel uses references
TEAM_ID ! DATABASE_ID ! RECORD_ID ! A14
The reference is made up multiple parts which are separated by !
and includes the team ID, database ID, record ID, and the cell ID. This allows AnyDB to uniquely identify the cell you are referencing.
- The cell will now be connected to the other record.
While this is the easiest way to connect records, this introduces a direct inflexible connection between the two records. If you want to create a more flexible connection that allows you to connect multiple records together, you can use the Attach or Link features.
VIA ATTACHMENTS: Attaching Records to a Record
AnyDB allows you to attach any number of records to another record by using the Attach feature. Attached records are displayed as a list of records that are connected to the parent record and they are all grouped together.
A record can be attached to multiple parents
This is useful for creating parent-child relationships between records. To attach a record to another record:
- Open the record you want to attach other records to.
- Click on the Attach button in the top right corner of the record view.
- Select the records you want to attach from the list of available records.
Once a record is attached to another record, to refer to the list of attached records, you can use the following formula syntax
C@RECORD_ID ! A1
This basically means get all the cells of the attached records of the record with the ID RECORD_ID
.
To refer to the the current record, you can use a handly special name which is CURRREC (short for current record).
C@CURRREC ! A1
This will return an array of values from the A1 cells of attached records of the current record.
[ 3000, 4000, 5000 ]
Given the array, you can perform various operations on it like summing the values, getting the average, etc. For example, to get the sum of all the attached records' A14 cells, you can use the following formula:
SUM(C@CURRREC ! A14)
VIA LINKS: Link to a specific record
You can also link records using a Reference Cell. This allows you to create a link to another record
To create a link to another record:
- Create a new cell in the record and set its type to Reference.
- To select a record to link to, click on the cell and select the record you want to link to from the dropdown list.
- The cell will now display the linked record's name.
- You can click on the linked record's name to navigate to that record.
Once you have linked a record, you can use a special function called DYNREF to dynamically reference the linked record's cell values.
To use the DYNREF function, you can use the following syntax:
DYNREF(REFERENCE_CELL, CELL_ID)
Where REFERENCE_CELL
is the cell that contains the linked record and CELL_ID
is the ID of the cell you want to reference in the linked record.
In this example below, Record 1 has a reference cell that links to Record 2. The formula in Record 1's cell B1 uses the DYNREF function to get the value of Record 2's cell A1.
DYNREF(B1, A1)
This will return the value of Record 2's cell A1 in Record 1's cell B1 which in this case 3000.
Now if you change the reference to Record 2 to Record 3, the value changes to 4000 automatically.