Hi guys!
I have this architecture on my tables. All data for the tables come from API.
In the table “Tasks” I have reference to the user. For this action I use the “Lookup()” formula.
Sometimes people in the table “Users” can be removed on the API side. After syncing the user removing in the table too. But the Tasks table has a reference to the removed user. After syncing I see an empty array in the needed row.
How I can allow only adding and updating data in the Users table during syncing and deny removing rows in the table?
Could you share some links to documentation, please? Maybe I miss something.
The Users table was created using this way:
pack.addSyncTable({
name: "Users",
schema: schema.UsersSchema,
identityName: "Users",
formula: {
name: "Users",
description: "Sync Users",
parameters: [],
execute: async function ([], context) {
let response = await fetcher.getUsers(context);
let results = [];
for (let user of response['users']) {
results.push({
id: user.id,
firstname: user.firstname ?? null,
lastname: user.lastname ?? null,
mail: user.mail ?? null,
});
}
return {
result: results,
};
},
},
});
Thank you!