derivative not able to read change in status of a cell #1492
-
I have added a derivative column to a row that listense to changes in another column called 'status' when the status is 'requested' it should run the function. Here is a snippet of my code:
} else { export default derivative; |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
One possible reason for this behavior could be that the To ensure that the condition is properly checked, you can modify your code to trim the Here's an updated version of your code with the modification: const derivative: Derivative = async ({ row, db }) => {
// Trim and convert row.status to lowercase
const status = row.status.trim().toLowerCase();
// Check if the status is 'requested'
if (status === 'requested') {
// Rest of your code
// ...
} else {
// If the status is not 'requested', do nothing
return { success: true, message: 'Transcription not requested' };
}
};
export default derivative; By trimming the |
Beta Was this translation helpful? Give feedback.
Hi @shaunnthomas
One possible reason for this behavior could be that the
row.status
value is not exactly 'requested' when you are expecting it to be. It is possible that there are leading or trailing spaces in therow.status
value, or the case of the string is different.To ensure that the condition is properly checked, you can modify your code to trim the
row.status
value and convert it to lowercase before checking the condition.Here's an updated version of your code with the modification: