Skip to main content
Solved

How to return the values of a related table, not the key

  • April 23, 2020
  • 1 reply
  • 15 views

Forum|alt.badge.img

how to return the values ​​of a related table, not the key, I try to do this from the javascrip api,

what i have is this:
const response = await airtablePlanes.list();

and he answers me:

[
{
“id”:“recJhPPsonGK6WQiO”,
“fields”:{
“valor_mensual”:4569,
“Name”:“PLAN_4”,
“planesToCoberturas”:[
“recGBXvrvXt6KhatT”,
“reckjMfRzp6jnHEED”,
“recCFBaAfBirzw6V3”,
“recg1TjYd6ekRHXqJ”,
“recM04lVdWj2CDIeI”
],
“descripcion”:"Plan 4 ",
“valor_anual”:54825
},
“createdTime”:“2020-04-08T22:25:48.000Z”
},
{
“id”:“recZQkZ6hI62FqvJ0”,
“fields”:{
“valor_mensual”:1286,
“Name”:“PLAN_1”,
“planesToCoberturas”:[
“reczIR8pPZBAJdSsM”,
“recH0CU0TqA9cfiFg”,
“receQ9xxWZqrtd2V9”,
“recG7E3gux8diAm2D”,
“recSsWKkZTCda0kab”
],
“descripcion”:“Plan 1”,
“valor_anual”:15431,
“registros”:[
“recovGEbYXVD3ISb3”
]
},
“createdTime”:“2020-04-08T22:24:27.000Z”
},
{
“id”:“recpDt0xL5yDPcrec”,
“fields”:{
“valor_mensual”:2380,
“Name”:“PLAN_2”,
“planesToCoberturas”:[
“rec9zIsScaSyFwTc0”,
“recRFqypir5CyMG9z”,
“recNIguFd32J9H5ma”,
“recDNT4YUmu239RoQ”,
“recYTUsK66G4pGne3”
],
“descripcion”:“Plan 2”,
“valor_anual”:28562
},
“createdTime”:“2020-04-08T22:24:27.000Z”
},
{
“id”:“recxR3bQvzTwBQWuh”,
“fields”:{
“valor_mensual”:3475,
“Name”:“PLAN_3”,
“planesToCoberturas”:[
“recc6L228XSOZhm8a”,
“recspsGloVFXRvEBc”,
“recKCFxagA1iUCEt0”,
“recGvuXaRL9XLDvQU”,
“recVSR2578CDeV4Bu”
],
“descripcion”:“Plan 3”,
“valor_anual”:41694
},
“createdTime”:“2020-04-08T22:24:27.000Z”
}
]

what I want is that in the matrix planesToCoberturas it returns the values ​​of each record of that linked table, not just the key, is this possible?

Thank you for your cooperation.

Best answer by kuovonne

Welcome to the Airtable community forums!

You cannot get the values within the linked records directly from the linked record field. Here are some alternatives:

  • You can create lookup fields in the table and then read the lookup values. The lookup fields will show up in the first table along with all the other fields.

  • You can find each individual record by id in its table to get the values

  • You can select the records from their own table, (using filterByFormula if necessary to limit the number of records returned)

1 reply

kuovonne
Forum|alt.badge.img+29
  • Brainy
  • 6009 replies
  • Answer
  • April 23, 2020

Welcome to the Airtable community forums!

You cannot get the values within the linked records directly from the linked record field. Here are some alternatives:

  • You can create lookup fields in the table and then read the lookup values. The lookup fields will show up in the first table along with all the other fields.

  • You can find each individual record by id in its table to get the values

  • You can select the records from their own table, (using filterByFormula if necessary to limit the number of records returned)