Greetings, I have experienced a brutally difficult learning curve attempting to create a new Task in Clickup using the api calls provided by both Pipedream and ClickUp.
ClickUp api documentation uses the word “body: {…}” when sending information to create a Task in ClickUp.
Using the Pipedream api calls for ClickUp with the same call to create a Task, uses the word “data: {…}”. Even though you can simply replace the url: string with the appropriate ClickUp call to create a Task, apparently with the Pipedream call you MUST use the word “data: {…}” in order for the information to process properly. When I did that, everything processed correctly.
Granted, I admit that it was probably because of my lack of understanding of how Node.js calls are executed using Node.js format, that caused such a delay in getting the call to process correctly, but in all of the documentation I reviewed for ClickUp, “body:” was the most common word found in the ClickUp documentation. It wasn’t until I discovered a link to create a task for the Twitter app that the word “data:” was used.
But now that I know, I’m able to process the call successfully each time. However, I had to put myself through a crash course in Node.js processing in order to understand what to look for when the process kept failing. It would have been helpful to have some type of message returning from the Pipedream error that the Task name failed because it was missing the word “data:”. Or better yet, have the Pipedream api call allow for the word “body: or data:” making them synonymous.
The next step is to know how to process “data/body” segment of the request with a dynamic string using data: { dynamicString }.
In the ClickUp api documentation for CreateTask shows the following string for body.
body: “{ “name”: “New Task Name”, “description”: “New Task Description”, “assignees”: [ 183 ], “tags”: [ “tag name 1” ], “status”: “Open”, “priority”: 3, “due_date”: 1508369194377, “due_date_time”: false, “time_estimate”: 8640000, “start_date”: 1567780450202, “start_date_time”: false, “notify_all”: true, “parent”: null, “links_to”: null, “check_required_custom_fields”: true, “custom_fields”: [ { “id”: “0a52c486-5f05-403b-b4fd-c512ff05131c”, “value”: 23 }, { “id”: “03efda77-c7a0-42d3-8afd-fd546353c2f5”, “value”: “Text field input” } ]}”
I need to know how to create a string with variable fields and values and not literals as shown above. I would like to create a string with an array of “taskField”: “taskValue” pairs, and then use that between the {…} brackets, where data: {…${ Stringified_Joined_ArrayOf_FieldNameValuePairs}…}.
Do I create an Array of FieldName: FieldValue sets, then join them as a string, and then use the JSON.stringify()? If so, how do I assign that dynamically created string with the data/body segment? Can you show me an example that works?
Thanks,
Scott.