APIs & Integrations

EBHamer
Member

Using Last activity date when creating a workflow via the API

SOLVE

I am trying to use the workflow creation API, /automation/v3/workflows/,  to create a workflow.  I would like to branch on the Last Activity Date property being greater than 7 days.  My JSON contains this:

...

"type": "BRANCH",
"filters": [
[
{
"operator": "GT",
"value": "7 Days",
"name": "Last activity date",
"property": "last_activity_date",
"type": "date"
}
]
],
"acceptActions": [],
"rejectActions": []

...,

 

but this always leads to an error containing this: "branchErrors":{"22811467":["BRANCH_WITHOUT_FILTERS"]}.

 

Is there a way to branch on the Last activity date?

0 Upvotes
1 Accepted solution
WendyGoh
Solution
HubSpot Employee
HubSpot Employee

Using Last activity date when creating a workflow via the API

SOLVE

Hey @EBHamer,

 

Are you looking to create a workflow with branch like this:

 

Screen Shot 2020-04-14 at 2.14.47 PM.png

 

 

If so, I believe the format of the branch will be something like this:

 

actions:[
{
type:"BRANCH",
actionId:169706893,
filtersListId:513,
filters:[
[
{
filterFamily:"PropertyValue",
withinLastTime:7,
withinLastTimeUnit:"DAYS",
reverseWithinTimeWindow:true,
withinLastDays:7,
withinTimeMode:"PAST",
operator:"WITHIN_TIME",
property:"notes_last_updated",
type:"datetime"}]],
acceptActions:[ ],
rejectActions:[ ]}],

It looks like you might be missing out a couple of things such as: filterFamily, withinLastTime, withinLastTimeUnit.

 

Could you try adding these information in and see if it works?

View solution in original post

0 Upvotes
3 Replies 3
WendyGoh
Solution
HubSpot Employee
HubSpot Employee

Using Last activity date when creating a workflow via the API

SOLVE

Hey @EBHamer,

 

Are you looking to create a workflow with branch like this:

 

Screen Shot 2020-04-14 at 2.14.47 PM.png

 

 

If so, I believe the format of the branch will be something like this:

 

actions:[
{
type:"BRANCH",
actionId:169706893,
filtersListId:513,
filters:[
[
{
filterFamily:"PropertyValue",
withinLastTime:7,
withinLastTimeUnit:"DAYS",
reverseWithinTimeWindow:true,
withinLastDays:7,
withinTimeMode:"PAST",
operator:"WITHIN_TIME",
property:"notes_last_updated",
type:"datetime"}]],
acceptActions:[ ],
rejectActions:[ ]}],

It looks like you might be missing out a couple of things such as: filterFamily, withinLastTime, withinLastTimeUnit.

 

Could you try adding these information in and see if it works?

0 Upvotes
EBHamer
Member

Using Last activity date when creating a workflow via the API

SOLVE

Wendy,

 

Thank you very much for your help.  This did work.

 

Where could I have looked to learn this for myself?

 

Thanks again,

 

Eric

0 Upvotes
WendyGoh
HubSpot Employee
HubSpot Employee

Using Last activity date when creating a workflow via the API

SOLVE

Hey @EBHamer,

 

Generally, what I'd recommend is to create a workflow of your team desire and use the Get workflows API to retrieve the specific parameter(s) needed for a particular action. 

0 Upvotes