mrloop
March 10, 2024, 8:53am
1
Suppose I have two tables users and projects
In users, there is a field called projects which is a link to projects
Now, when I get a row of users table through GET api, I get the data in this format
...
"projects": [
{
"id": 1,
"value": "project1"
},
...
]
....
The problem is that projects table also has other fields that I want to get populated in the objects of array for ex. progress or timestamp.
I tried createing lookup for those but they are coming as separate fields through the api instead of concatenating inside the object.
Any help is appreciated
bram
March 11, 2024, 10:32am
2
Hi @mrloop , it’s currently only possible to join in values from another table by creating a lookup field. It will be added as a separate field in the table, but you can match the index of the item in the field with each other.
...
"projects": [
{
"id": 1,
"value": "project1"
},
{
"id": 1,
"value": "project2"
},
],
"lookup": [
{
"value": "field matching project1"
},
{
"value": "field matching project2"
}
]
mrloop
March 11, 2024, 4:57pm
3
I guess that’s the only workaround, provided, I hope, that the array order is deliberately consistent through all lookups.
bram
March 12, 2024, 9:26am
4
Yes, this is deliberately consistent.