Hi Team,
I am writing a pack to return the salesforce user as coda user. pfb my code snippet
// 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