Hi, I’m trying to use the approach listed here : Approximating two-way sync - Coda Pack SDK
It works fine for simple values, however I always loose lookups referencing other tables synced from the same pack, despite returning the exact same value as the one returned by the sync table. They are just returned as object chips.
Some relevant code :
I have an “User” sync table and an “Organization” sync table referencing the “User” one.
const UserSchema = coda.makeObjectSchema({
properties: {
user_id: {
type: coda.ValueType.Number,
required: true,
fromKey: 'id',
},
name: {
type: coda.ValueType.String,
required: true,
},
},
displayProperty: 'name',
idProperty: 'user_id',
featuredProperties: ['name'],
});
const UserReference = coda.makeReferenceSchemaFromObjectSchema(UserSchema, 'User');
const OrganizationSchema = coda.makeObjectSchema({
properties: {
organization_id: {
type: coda.ValueType.Number,
fromKey: 'id',
required: true,
description: 'The ID of the organization',
},
name: {
type: coda.ValueType.String,
required: true,
description: 'The name of the organization',
},
owner: {
...UserReference,
description: 'The owner of the organization',
},
},
displayProperty: 'name',
idProperty: 'organization_id',
featuredProperties: ['name'],
});
The action that should update row in Organization synctable :
pack.addFormula({
name: 'UpdateOrganization',
description:
'Update an organization. Will update row immediately in Organizations syncTable upon successfull update.',
parameters: [parameters.organization.update.organizationID],
varargParameters: [parameters.organization.update.fieldKey, parameters.shared_optional.fieldValue],
isAction: true,
resultType: coda.ValueType.Object,
schema: coda.withIdentity(OrganizationSchema, 'Organization'),
execute: action.organization.update,
});
If I return this :
{
"id": 212,
"name": "TEST",
"owner": { "id": 12910344, "name": "Test User" }
}
I will only get an object chip and not the lookup.
Is this a known limitation or a bug or something I overlooked ?