Skip to main content

Hi,

I've been trying to learn and build a script with the help of ChatGPT. The script creates a report in Clockify and all works fine until I replace the value input variable from a fixed value to a feiled in the base from a previous step. 

The value is just a string but is actually a lookup from another table. I've tried to use a formula in another field and use that but both result in the error seen in the screen shot.

I feel like I'm so close, any advise ?  

Looks like you don't need the [] around projectId in your projects filter as it's already an array. Also, not necessary, but if that is the case I would update that variable to be called projectIds as it might help you keep track.

To clarify;

 

//an array of strings with length 1
const projectId = ['abcdefg'];

console.log(projectId);
//returns ['abcdefg']

console.log([projectId]);
returns [['abdcedfg']]

 


Looks like you don't need the [] around projectId in your projects filter as it's already an array. Also, not necessary, but if that is the case I would update that variable to be called projectIds as it might help you keep track.

To clarify;

 

//an array of strings with length 1
const projectId = ['abcdefg'];

console.log(projectId);
//returns ['abcdefg']

console.log([projectId]);
returns [['abdcedfg']]

 


Nice one Jack. Exactly right. Thanks for your help and explanation


Reply