Pipedream and ClickUp create Task with dynamic values

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.

@sjn001tvh I hear you on the confusion. data is used by axios (see this example HTTP request), a common HTTP library we use to send requests on Pipedream. We can’t change how they refer to the body / payload of the HTTP request in that library. The ClickUp API docs use the request library, which uses the term body, as you note. You’ll see a lot of these inconsistencies across libraries, and my best advice is to always refer to the docs on the package you’re using, which should make it more clear.

For your specific question, can you show me an example of the data you’re referencing in your workflow, and specifically what you’d like as output? For example, it would help if you could frame your problem in a way like:

"I have an array of task IDs in the variable steps.trigger.event.tasks that look like:

[1, 2, 3]

and I’d like to convert that to data that looks like:

1,2,3

"

Right now I’m not sure exactly what your input data looks like and exactly what you want the output to look like, so that would help.

Thanks,
Dylan

Hi Dylan,

Just wanted you to know that I have been able to move a file from Dropbox, manipulate the file, and successfully transfer the contents of my Phone Contact Data, directly into ClickUp, without having to retype the information.

The whole purpose for using Dropbox is to create folder which, by design, is meant to be empty. Then if a file is created in that directory it triggers reading a Routing file which contains the following information.

File: ##-*.txt | /ClickUp_WSFolders
File: p.txt | /ClickUp_WSFolders/Projects

If a file contains a specific format, or a specific name, then the it moves that file to directory path specified.

As I have been testing these files, I enter 00-0.txt and it processes correctly and moves the file to the appropriate directory. This should leave the repository directory empty. However, when I create a file named “p.txt” nothing seems to happen, but “pp.txt” triggers the event. That leaves “p.txt” in the directory. I’m not sure the event is requiring the basename of the file to be more than a single character.

Yet, when the “p.txt” file is created, if I click on the last item in the Events List (left side), the file shows up. But it doesn’t process it, until I select Deploy, and then by Send It just doesn’t seem to be consistent in its operation, and leaves the file in that directory.

What I’m looking for is a trigger, that if a file exists in the directory, then process into a different directory leaving that directory folder empty. That’s how I know that the files are being processed. So how do I create a trigger step that when activated,

  1. Upon activation, it searches a specific directory
  2. If it finds a file, processes it according the routing file,
  3. Then waits for a new file to be created, repeat step 2.

The only options I have available to me, is if there’s actually a New File created. That means in order to test the workflow step, I have to delete the file that exists in the directory, or edit the file, which creates an update status, or recreate it.

The source code that processes that api call, shows the following,

async run(event) {
const updates = await this.dropbox.getUpdates(this);
for (update of updates) {
if (update[".tag"] == “file”) {
if (this.includeMediaInfo) {
const dpx = await this.dropbox.sdk();
update = await dpx.filesGetMetadata({
path: update.path_lower,
include_media_info: true,
});
if (update.result) {
update = update.result;
}
}
if (this.includeLink) {
const dpx = await this.dropbox.sdk();
let response = await dpx.filesGetTemporaryLink({
path: update.path_lower,
});
if (response.result) {
response = response.result;
}
const { link, metadata } = response;
update.link = link;
}
}
this.$emit(update);
}
},

I would like to modify this code so that it first lists the files in the directory, and if 1 or more files exist, trigger the next step, or else wait for the next file. What it does now, is it ignores any files that exist in the directory at the time the trigger was started, and waits for another file. I only want to bypass the updates list when the trigger gets initiated.

Is this possible?

Thanks,

Scott.