这个错误通常是因为目标连接器中没有对应的ID而导致的。可以使用以下代码示例来解决此问题:
try {
// Upsert record to destination connector using the appflow api
const response = await appflowClient.createOrUpdateRecords({
flowName, // Name of the flow used in Appflow
destinationConnectorId, // ID of the destination connector in Appflow
streamName, // Name of the stream in Appflow
records: [{ // Sample record to upsert
id: '123', // ID of the record to upsert
name: 'Sample Record',
email: 'sample@example.com'
}]
});
} catch (error) {
console.log(`Appflow upsert error: ${error.message}`);
}
在这个示例中,我们可以看到一个简单的 Upsert 操作,可以在目标连接器中更新特定的记录。您可以将您自己的记录ID和字段值替换为示例中的数据。同时,可以检查记录是否已存在于目标连接器中,以避免该错误。