Pipedrive : how to get daily activities from a User

Hey guys

I am trying to build a dashboard for pipedrive = get all activities done yesterday by a user
→ So i try to list all activities mark as done between the day before and today.

The following flow is working except that “start date” are not taken into account… : i have a list of all activities since many weeks before the “end date”

Has anyone had this problem ?

A couple of things. You connected both dates to the Pipedrive node, but the Pipedrive node it’s not going to wait for both dates and then execute. It will run two times, one with the start date and the end date. Hence, the node executes with a missing date each time. The second issue, you are passing the dates to Pipedrive with the format YYYY-MM-DD, but the API expects ISO 8601.

The example below should solve the issue. To test it, copy it and paste it into a new workflow.

So many thanks @RicardoE105 !
I am going to try that :wink:

So it works perfectly @RicardoE105 !!Great !

My aim now is to know how many tasks are done by this user (“type” field in pipedrive data) : call, email, task…

i was thinking using a “switch” node or maybe “set” node to detect wich type it is but i do not know how to count them …

You can do that with a function node. The example below should do it.

const results = {};

for (const item of items) {
  if (item.json.done === true) {
    if (results[item.json.type] === undefined) {
      results[item.json.type] = 0;
    } else {
      results[item.json.type] = results[item.json.type] + 1
    }
  }
}

return [
  {
    json: {
      ...results
    }
  }
]

This is fantastic!
So many thanks

I was planning to publish this workflow on the WorkFlow Community page to help other people, is this ok for you @RicardoE105 ? (i will mention your great help ! of course)

Glad that it worked. You can share the workflow and not need to mention me at all. Let us know if you have further questions.