Here are two approaches…
-
You could use a lookup field to pull over the value from the other table - this way it’s already part of the selected record when your script runs.
-
If you don’t want to do that, you’ll need to select the record on the other table in order to use the getCellValue()
method.
If the linked record field you’re referencing only has one value in it (I.e is only linked to one record on the other table), the following code should work for you:
let recordToSelect = selectedRecord.getCellValue("Linked Record Field Name")[0];
let recordFromOtherTable = await otherTable.selectRecordAsync(recordToSelect.id);
let valueFromOtherTable = recordFromOtherTable.getCellValue("Field From Other Table");
The above is drastically simplified but if you want to share more info I’m happy to help you adjust for your code / use case :slightly_smiling_face: