# Sync Tables fails without an error in Pack Maker tools - Retrieve Coda user

**URL:** <https://connect.superhuman.com/t/sync-tables-fails-without-an-error-in-pack-maker-tools-retrieve-coda-user/30506>\
**Category:** Making Packs\
**Created:** [May 6, 2022, 12:52pm UTC](https://connect.superhuman.com/t/sync-tables-fails-without-an-error-in-pack-maker-tools-retrieve-coda-user/30506 "2022-05-06T12:52:47Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Elam\_Jaybal](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/elam_jaybal/32/26319_2.png) [@Elam\_Jaybal](https://connect.superhuman.com/u/Elam_Jaybal)\
**Post date:** [May 6, 2022, 12:52pm UTC](https://connect.superhuman.com/t/sync-tables-fails-without-an-error-in-pack-maker-tools-retrieve-coda-user/30506/1 "2022-05-06T12:52:47Z")

</div>

Hi Team,

I am writing a pack to return the salesforce user as coda user. pfb my code snippet

```auto
// A User schema defining the data in the sync table.
const UserTestSchema = coda.makeObjectSchema({
  codaType: coda.ValueHintType.Person,
  properties: {
    email: {
      description: "Email of the User.",
      type: coda.ValueType.String,
      required: true,
    },
    name: {
      description: "The Username of the User.",
      type: coda.ValueType.String,
    },
  },
  displayProperty: "name",
  idProperty: "email",
  featuredProperties: ["name", "email"],
  identity: {
    name: "UserTest",
  },
});

//Table to sync salesforce Users with Coda
pack.addSyncTable({
  name: "UsersTest",
  schema: UserTestSchema,
  identityName: "UserTest",
  formula: {
    name: "SyncUsersTest",
    description: "Sync Users Table",
    parameters: [],
    execute: async function ([], context) {

      let listUrl = salesforce_account + salesforce_query + "SELECT+ID+from+User";

      let response = await context.fetcher.fetch({
        method: "GET",
        url: listUrl,
        cacheTtlSecs: 0,
      });
      let results = response.body.records;

      let userResults = await iterateUsersTest(context.fetcher, results);

      return {
        result: userResults,
      };
    },
  },
});

```

It is properly fetching the results and is not rendered in coda sync table saying the sync failed. There is no error in the logs. Any help in resolving the issue. Thanks in Advance.

Thanks,  
Elam

---

<div class="post-metadata">

**Author:** ![Eric\_Koleda](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/eric_koleda/32/50286_2.png) [@Eric\_Koleda](https://connect.superhuman.com/u/Eric_Koleda)\
**Post date:** [May 6, 2022, 5:36pm UTC](https://connect.superhuman.com/t/sync-tables-fails-without-an-error-in-pack-maker-tools-retrieve-coda-user/30506/2 "2022-05-06T17:36:18Z")

</div>

Hi @Elam_Jaybal - Looking back at the [documentation](https://coda.io/packs/build/latest/guides/basics/data-types/#people) on Person references I can see how I didn’t provide quite enough information. The schema you defined looks fine, but it’s mean to be used within a property of a larger schema that represents a sync table row.

```nohighlight
const PersonSchema = coda.makeObjectSchema({
  codaType: coda.ValueHintType.Person,
  // ...
});

const BookSchema = coda.makeObjectSchema({
  properties: {
    title: { type: coda.ValueType.String },
    author: PersonSchema,
  }
});

pack.addSyncTable({
  name: "Books",
  schema: BookSchema,
  // ...
});

```

In that example each row in the “Books” sync table would have a “Title” columns with text and a “Author” column with the person chip. Let me know if that helps clear up the intended usage.

---

<div class="post-metadata">

**Author:** ![Elam\_Jaybal](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/elam_jaybal/32/26319_2.png) [@Elam\_Jaybal](https://connect.superhuman.com/u/Elam_Jaybal)\
**Post date:** [May 6, 2022, 6:09pm UTC](https://connect.superhuman.com/t/sync-tables-fails-without-an-error-in-pack-maker-tools-retrieve-coda-user/30506/3 "2022-05-06T18:09:20Z")

</div>

Hi Eric,

Thanks for the quick response. Let me work out and get back to you.

Thanks,  
Elam

---

<div class="post-metadata">

**Author:** ![Elam\_Jaybal](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/elam_jaybal/32/26319_2.png) [@Elam\_Jaybal](https://connect.superhuman.com/u/Elam_Jaybal)\
**Post date:** [May 9, 2022, 4:58pm UTC](https://connect.superhuman.com/t/sync-tables-fails-without-an-error-in-pack-maker-tools-retrieve-coda-user/30506/4 "2022-05-09T16:58:44Z")

</div>

Hi @Eric_Koleda

Thanks for your help. It works fine. The syntax was described in the referenced data type. I missed checking from that. Sorry for that. Thanks again.

Thanks,  
Elam

---

<div class="post-metadata">

**Author:** ![system](https://yyz1.discourse-cdn.com/coda1/user_avatar/connect.superhuman.com/system/32/24484_2.png) [@system](https://connect.superhuman.com/u/system)\
**Post date:** [August 7, 2022, 4:58pm UTC](https://connect.superhuman.com/t/sync-tables-fails-without-an-error-in-pack-maker-tools-retrieve-coda-user/30506/5 "2022-08-07T16:58:57Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
