Bug when approximating two-way sync for lookup columns?

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.
Capture d’écran 2023-03-31 à 12.28.50

Is this a known limitation or a bug or something I overlooked ?

Hi @Martin_Portevin - This is unfortunately a known issue, and one we are tracking internally. It doesn’t look like I mentioned it anywhere in the documentation, and given how long it’s been broken for it probably makes sense to document it. Would the 2-way sync page be where you would expect to include this info?

Thank you @Eric_Koleda,
still hoping for a bright future for two-way sync :upside_down_face:

Yep, Approximating two-way sync - Coda Pack SDK is the place I would expect to find the info.

Upvoting this issue as this bug is preventing us from syncing tables across docs with lookup columns