Skip to main content

Hi Fellow Experts who code!

 

I’ve got a perplexing issue that I just cannot figure out. I’ve got an effective workaround for it, but would love to know if anybody knows the root of the issue and whether this is an issue with ClickUp or Zapier.

 

When you call a task from ClickUp (via either native Zapier app or webhook), it returns a standard JSON payload which has grouped information that should, in theory, be easy to parse.

 

 

But when you bring this into a subsequent step (in my case, a code step), it separates it into a whole bunch of categories as strings with comma separated values (ex, Field Names: “Name, Phone, Email, Address, City”). When a particular category doesn’t have values at a particular index, it shows consecutive commas (ex. Field Values: “Todd Harper,,,,Minneapolis”).

 

None of this is particularly a problem. BUT...for some reason, Zapier completely ignores the consecutive commas. It’s just as if they don’t exist. No amount of data manipulation, .replaceAll(“,,” , “, ,”), or other strategies I’ve tried over the course of a couple of months or so have been successful. Typing out a test string with exactly the same data returns as expected:

 

These are the actual data and an identical test string written in a Code by Zapier step.
This is the output of the “identical” strings.

This makes it impossible to return, for example, the item at index “email”, because email should be in the 9th position, but for some reason, it’s in the 3rd.

 

Any ideas???

Edit:

Since you are currently working with line-items, which can be a bit more complicated to manipulate, if you use a previous step Formatter by Zapier (Event: Utilities, Transform: Line-item to Text), you will be able to build a comfortably manipulable text for your next step Code by Zapier.

In the Formatter step, in the Input field, I would place the data Task Custom Fields Names and Task Custom Fields Values ​​with a colon (:) between them. And the separator would set them as a comma (,).

This way, you'd get plain text like "Name:Jhon,Last Name:,Email:jhondoe@email.com" (the last name value has been intentionally omitted to illustrate your problem). So in the Code by Zapier step, you can apply split functions: https://www.w3schools.com/jsref/jsref_split.asp First to split by comma, then you index and get the desired value. Then you separate that value by a colon and finally index the second element to get the final desired value.


Actually @Expreso Agencia Digital, in my moment of desperation, I actually just managed to resolve the issue for an unlimited number of custom fields in a single Javascript code step (webhook and data parsing all inclusive).

Until I posted this, I was working on the assumption that it was a problem with the way ClickUp was sending it’s payload. But now that I’ve resolved the issue, I think it might actually be an issue with Zapier’s backend code and the way it’s handling and parsing the data. By cutting out the middleman (ie. getting the payload and parsing it in one code step instead of getting it in one step and then using the comma separated string Zapier creates (seen in my second photo above)), it works like a charm.


Well, we had edited our initial answer with a specific workaround, but glad you found a solution. Happy day Todd.


Hi Todd,

 

I’m in this situation before and I guess the root of the problem is Zapier always auto trim all the blank element from an object

The best way works around is instead using the Click Up / Webhook step. You using the coding step to get the result from ClickUp API and format the result exactly as you want. If you feel like the next coding step is not complicate you can merge these 2 into just 1 coding step.

Hope this can answer your question.


Hi @Todd Harper 

Try using Formatter > Utilites options related to handling line items


Hi Todd,

 

I’m in this situation before and I guess the root of the problem is Zapier always auto trim all the blank element from an object

The best way works around is instead using the Click Up / Webhook step. You using the coding step to get the result from ClickUp API and format the result exactly as you want. If you feel like the next coding step is not complicate you can merge these 2 into just 1 coding step.

Hope this can answer your question.

 

@Do Anh Tran This is exactly the solution I used and it works like a charm! It all happens in a single code step without requiring a ClickUp or Webhook step 🙂 Thanks!


Actually @Expreso Agencia Digital, in my moment of desperation, I actually just managed to resolve the issue for an unlimited number of custom fields in a single Javascript code step (webhook and data parsing all inclusive).

Until I posted this, I was working on the assumption that it was a problem with the way ClickUp was sending it’s payload. But now that I’ve resolved the issue, I think it might actually be an issue with Zapier’s backend code and the way it’s handling and parsing the data. By cutting out the middleman (ie. getting the payload and parsing it in one code step instead of getting it in one step and then using the comma separated string Zapier creates (seen in my second photo above)), it works like a charm.

Hey Todd, can you share more info on how you were able to complete this with some Javascript?