Clickup task create: additional fields

Hi,

I’ve created my first workflow which is getting data from a webhook and creating tasks in clickup. The clickup node has got good parameters to use but I have a question regarding the “Additional fields” when creating the tasks:
“Custom Fields JSON”: I’ve managed to use this but only with static data. Is there a way the value for the field can be taken from a previous node i.e. {{$node["webhook"].json["body"]["key"]}}?

In general, is it possible to add some other additional fields or would that require a change in the clickup node code?

Cheers
Rich

Hi @Richard0815, welcome to the community :tada:

When clicking on the little gears icon next to the field, you can add an expression:
image

This would allow you to reference data from a previous node. I s this what you had in mind?

1 Like

Hi,

thanks for the quick reply! Silly me, I was only clicking in the text field hence I didn’t get the option to set values with previous data. Thanks!

Is there a way to add more additional fields?

Cheers,
Rich

The format is that of a JSON array, so you should be able to add multiple fields using a value like this in the Custom Fields JSON field:

[{
    "id": "ID of the first field",
    "value": "Value of the first field"
}, {
    "id": "ID of the second field",
    "value": "Value of the second field"
}, {
    "id": "ID of the third field",
    "value": "Value of the third field"
}]

Hi,

This works really nicely and above that I understand now how it’s working!
Thanks a lot.

Cheers,
Rich

1 Like

Awesome, I am glad to hear that. Thanks a lot for confirming and happy automating!

Hi MutedJam,

How would I add something from a previous node as the value?

e.g. this is the expression for the value from another node:
{{$node["Webhook from Barn Website"].json["body"]["submission"]["email-1"]}}

So would the Custom Fields JSON be (using a fictitious id for this example):
{"id":"112345678789","value":"{{$node["Webhook from Barn Website"].json["body"]["submission"]["email-1"]}}"}

Thanks for any help.

Hi,

The items array gets past on to the current node so, I think you can access the data like this:
{{$json["body"]["submission"]["email-1"]}}

Don’t count me on that but it seems to work for me.
In general you can always reference the data with the node array.

That’s how it works for me:

[{
    "id": "c8d704f3cec0",
    "value": "{{$node["any node"].json["body"]["fields"]["number"]}}"
}, {
    "id": "048b889314f6",
    "value": "{{$node["any other node"].json["body"]["fields"]["anothernumber"]}}"
}]

Cheers,
Rich

Hi Rich,

Thanks for that, I tried with your suggestion but that still isn’t working for me.

If I just add a string it works fine, but not with the node json, that gives me the error:

Custom Fields: Invalid JSON

Which is an error from here (I think)-

(found in this question - Reading json parameter in custom node - #2 by MutedJam )

Not an answer but one step closer :slight_smile:

OK, my bad, I should have followed the correct process :frowning:

I was adding the JSON directly into the field (by clicking on the field itself).
If I use the gears icon to add an expression (as detailed in the previous post by MutedJam) it works!

It creates the same JSON but must do something in the background to replace the value.

:man_facepalming:

Hi! I am having trouble using this custom fields JSON. Is there a way to confirm the ID of the custom fields? I have done this by using get all tasks via clcikup node, but I keep getting an error message:

NodeOperationError: Custom Fields: Invalid JSON
at Object.execute (/usr/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/ClickUp/ClickUp.node.js:716:39)
at Workflow.runNode (/usr/lib/node_modules/n8n/node_modules/n8n-workflow/dist/src/Workflow.js:526:37)
at /usr/lib/node_modules/n8n/node_modules/n8n-core/dist/src/WorkflowExecute.js:451:62
at processTicksAndRejections (internal/process/task_queues.js:95:5)

this is a copy of the json I am using:

[{
“id” : “a30fa31d-324a-4e3d-bfd2-3e96ea217de5”,
“value” : “{{$node[“IF”].json[“name”]}}”
}]

I have tried using simple string as well, but error persists

[{
“id” : “a30fa31d-324a-4e3d-bfd2-3e96ea217de5”,
“value” : “TEST”
}]