Struggling to pull correct data using webhook, loop and filter into Hubspot
Hello,
We use a business software that manages our accounting, contracts, inventory, etc. They have provided an API (and documentation) that we can use to pull this data into our Hubspot account. So far, in Zapier, I’ve been able to set up the Schedule by Zapier, the Webhook, Loop, Filter, and the Create Company > Hubspot. The API is correctly pulling the data I need, however, our contract data goes back to 2017 and I’m trying to only pull in data from 2022 going forward.
In the webhook, I’ve tried to use different queries such as; url: /api/v1/revenue/recognized Query: contract_start_date Value: 2022-01-01
This didn’t work. So I set up a filter, basically using contract_start_date, Date/Time > After, 2022-01-01 which didn’t work either.
It’s pulling data from the very beginning and I can not for the life of me figure out how to only pull the data after 2022.
I have the documentation if that would help but wasn’t sure if I should link it here.
Any help would be very much appreciated.
Page 1 / 1
Hi @whistlerdev
That will depend on the app API endpoint documentation for how to filter the query (if supported).
Link to the app API endpoint documentation you used to configure the Zap step with the API request.
For us to have full context, post screenshots showing:
how your Zap steps are outlined
how your Zap steps are configured in EDIT mode with the field mappings visible
Thank you for the reply Troy. I hope the following helps.
Step 2: In the URL field, it looks like you have an extra line break that should be removed.
Step 3: You have an extra blank key/value pair that should be removed.
For the API request, these are the available Filters based on the documentation link.
In Zap step 2, you would configure those in the section: Query String Parameters.
Thank you for pointing out the line break, that is now gone.
As for the query parameters, yes I used those but it didn’t seem to work. I may have entered the wrong info. Here is what I placed in the left field: revenue_period and in the right field I just put 2022.
Edit: I also used the combination of the year and month as the example in their doc says: 2022-01
@whistlerdev
For us to have true context, post screenshots showing how your Zap step is configured in EDIT mode with the field mappings visible. (SHOW & TELL)
I’m assuming this is what you’re referring to?
@whistlerdev
Need to see screenshots for your Zap step 2 API request from the CONFIGURE tab.
Weird. I’m submitting replies to you but it disappears. Anyways, yes I included that screen shot above, which you pointed out that I had an extra line space. I cut off the bottom because it includes the API key underneath ‘Bearer.’
@whistlerdev
None of those screenshots show how your had your Zap step 2 API request configured with the query string parameters you were trying to use along with any encountered errors for testing.
Understood. This is what did look like when I had that information in there. When I tried this, I wasn’t using the Filter by Zapier action. I only added that Filter action after the below screenshot did not pull the data I was looking for.
My apologies, I’ve been changing this so many different ways Im losing my mind. Here is another I tried that did not work. All returned the same info in the Loop test as screenshotted above.
I’ve tried it both ways, both screenshots above and they produced the same results with what came back from the API.
Both of which were used without the Filter action. I had read that the filter action was done via Zapier rather than server side. Still, it came back with the same results.
You can NOT filter by “contract_start_date” as part of the API request, because the API endpoint documentation does NOT indicate that is a supported filter option.
You can filter by these as part of the API request, because the API endpoint documentation does not indicate that is a supported filter option.
office
product_type
revenue_category
revenue_period
If you don’t filter the API request, it will return 100 results.
That means pagination potentially comes into play as well as rate limits, and you would need to have logic to handle those.
Default page size is 100.
Max page size is 1000. (e.g. ?page_size=1000)
Default rate limit is 60/minute/IP.
Increased rate limit upon request.
If you are trying to filter by a data point that is returned as part of the records data, then a different approach may be needed.
It may make more sense to use a CODE (JavaScript / Python) step to make the API request and handle the response to do the filtering.
Thank you for pointing out the line break, that is now gone.
As for the query parameters, yes I used those but it didn’t seem to work. I may have entered the wrong info. Here is what I placed Salon and spa services in the left field: revenue_period and in the right field I just put 2022.
Edit: I also used the combination of the year and month as the example in their doc says: 2022-01
This challenge typically arises when the webhook does not properly capture the desired data, the loop fails to iterate over the right data set, or the filter criteria are too restrictive or incorrectly applied. To resolve this, ensure that the webhook is correctly set up to receive the necessary data, verify that the loop is properly structured to iterate over the expected data array, and carefully review the filter conditions to ensure they match the intended criteria.