I am attempting to use the data within a ‘Connection’ field inside of a ‘Text Formula’ in another table, but I don’t seem to be able to select the connection as an option. Is it not possible to use a connection in a Text Formula? I’ve outlined the structure below.
Grateful for any help 
Table - Employment Record
- Connection (Primary Contract)
- Connection (Primary Location)
Table - Absence (contains a connection to the Employment Record table)
- SYS - Primary Contract
- Should show the Primary Contract Connection from Employment Record
Hi @AnthonyF96,
Unfortunately you cannot fetch a connection field value from a separate table in a text formula. Here are two options below:
Option 1: Text formula
The hack is to add a text formula field to display the connection value in the originating table (e.g. employment record).
Table - Employment Record
- Connection (Primary Contract)
- Text Formula -
{Employment Record Primary Contract.Name}
- Connection (Primary Location)
Table - Absence (contains a connection to the Employment Record table)
- SYS - Primary Contract -
{Absence Employment Record.Text Formula}
Option 2: Connection
The other method is to have a connection to your Primary Contract table in your Absence table, and each time an Absence is created, update its Primary Contract connection value to the same value as the connected Employment Record. This works a lot better for filtering purposes.
Table - Absence (contains a connection to the Employment Record table)
- Connection (Primary Contract)
Let me know if you go with any of these methods or something else!
Hi Stephen, thank you for your help! I’ve managed to use the API to dynamically pull the information I need from one table into the other. Creating live records at the time without any user input being required, thank you. 
Hi @StephenChapman,
I don’t suppose you know if it is possible to obtain the record_id from a form? I currently have a dropdown that lists all staff members from the staff table, but I have to search for the name in the API instead of being able to pull the record/staff ID from the form and then search with this. Thank you 
You can export the record IDs now if you export the Staff table, it’s a feature that Knack has added to tables now.
@AnthonyF96, do you mean the record ID of the submitted form, or the record ID of the connected record?
Let’s pretend your form-submit listener returns this, where field_123 is your Staff connection:
{
"id": "123abc",
"field_123_raw": [
{
"id": "456def",
"identifier": "John Smith"
}
]
}
You can get the record ID of the submitted form with:
const recordId = record.id;
Or the record ID of the connected value with:
const recordId = record?.field_123_raw?.[0]?.id;
Where [0] is the first (and only) connection in the array.
Does that help?
I’ve included a photo below, which I hope explains what I mean. I’d like to dynamically pull the data before I submit the form, which I currently have to do for the staff name.
Is it possible to pull the record ID from the ‘OPS - STAFF’ table using the data present in the form before submission? I hope I’ve explained it a bit better this time.
@AnthonyF96,
The Knack team has recently added some event listeners for forms in Next-Gen which can listen for a form input value being changed:
Knack.on('view:render', ({ viewKey }) => {
if (viewKey === 'view_xx') { // Replace view_xx with your form key
const form = Knack.page.getForm(viewKey);
form.onFormChange = ({ changedFieldKey, changedValue }) => {
if (changedFieldKey === 'field_xx') { // Replace field_xx with your connection field key
const connectionId = changedValue?.[0]?.id || '';
// Do something with connectionId
}
};
}
});
connectionId returns the selected dropdown option’s ID. You can then use this value how you like.