# Updating Data to SQL Server through certain deal properties update date

**URL:** <https://community.hubspot.com/t/updating-data-to-sql-server-through-certain-deal-properties-update-date/59645>\
**Category:** APIs & Integrations\
**Tags:** python, object, webhooks\
**Created:** [June 23, 2022, 1:05pm UTC](https://community.hubspot.com/t/updating-data-to-sql-server-through-certain-deal-properties-update-date/59645 "2022-06-23T13:05:58Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![JLeandroCorre](https://avatars.discourse-cdn.com/v4/letter/j/a88e4f/32.png) [@JLeandroCorre](https://community.hubspot.com/u/JLeandroCorre)\
**Post date:** [June 23, 2022, 1:05pm UTC](https://community.hubspot.com/t/updating-data-to-sql-server-through-certain-deal-properties-update-date/59645/1 "2022-06-23T13:05:58Z")

</div>

Hello everyone!

I want to update my SQL database that reflects my hubspot deals but not using the last\_modified\_date, since it brings too mutch deals that actually didn´t brings us nothing new for our business (updating certain marketing property that doesn´t change anything in our analysis);

**So what I want to do is, through an API, to update my deals database if 4 tipes of properties (using OR statement) were updated in the last 24 hours.** I was using the SEARCH API, but I didn´t found how to filter then by the update date of these specific properties.

I´ve already tried different ways using workflows + webhooks, but in all cases the updates were not precise as I need to be;

---

<div class="post-metadata">

**Author:** ![Jaycee\_Lewis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jaycee_lewis/32/61352_2.png) [@Jaycee\_Lewis](https://community.hubspot.com/u/Jaycee_Lewis)\
**Post date:** [June 24, 2022, 6:22pm UTC](https://community.hubspot.com/t/updating-data-to-sql-server-through-certain-deal-properties-update-date/59645/2 "2022-06-24T18:22:47Z")

</div>

Hey, @JLeandroCorre 👋 Thanks for the interesting question. Can you share an example request and response using the Search API? Even if it didn’t return the expected result? Let’s also see if we can get the conversation started — @jpsanchez @taran42 @lynton @johnelmer, do you have any experience here?

Thank you all very much! — Jaycee

---

<div class="post-metadata">

**Author:** ![JLeandroCorre](https://avatars.discourse-cdn.com/v4/letter/j/a88e4f/32.png) [@JLeandroCorre](https://community.hubspot.com/u/JLeandroCorre)\
**Post date:** [June 24, 2022, 7:13pm UTC](https://community.hubspot.com/t/updating-data-to-sql-server-through-certain-deal-properties-update-date/59645/3 "2022-06-24T19:13:58Z")

</div>

Yes, [@Jaycee\_Lewis](https://community.hubspot.com/t5/user/viewprofilepage/user-id/127074) , of course I can!

```lia-code-sample
payload = {
 "filterGroups": [
 {
 "filters": [
 {
 "propertyName": "pipeline",
 "operator": "EQ",
 "value": "3308305"
 },
 {
 "propertyName": "hs_createdate",
 "operator": "BETWEEN",
 "highValue": hoje_i,
 "value": ontem_i
 }
 ]
 } 
 ],
 "properties": [
 "hs_lastmodifieddate"
 ],
 "limit": "100",
 }

```

This is my latest version of the payload I´m trying to use in my request. All I want to do is to use as a filter the timestamp of a property such as hubspot\_owner\_id;

I know that every object\_id has it´s latest update timestamp, as shown right here:

```lia-code-sample
"hubspot_owner_id": {
			"value": "56548127",
			"timestamp": 1654867152803,
			"source": "API",
			"sourceId": "PublicObjectResource",
			"updatedByUserId": null,
			"versions": [
				{
					"name": "hubspot_owner_id",
					"value": "56548127",
					"timestamp": 1654867152803,
					"sourceId": "PublicObjectResource",
					"source": "API",
					"sourceVid": [],
					"requestId": "6a07000f-ecc6-4a34-8f7b-a66d1c1e1df4"
				}

```

Is it possible to make it? If don´t, how can I filter the data to update my SQL database with only the deals that had certain properties updated in the last 24 hours?

---

<div class="post-metadata">

**Author:** ![taran42](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/taran42/32/105524_2.png) [@taran42](https://community.hubspot.com/u/taran42)\
**Post date:** [June 27, 2022, 3:01pm UTC](https://community.hubspot.com/t/updating-data-to-sql-server-through-certain-deal-properties-update-date/59645/4 "2022-06-27T15:01:25Z")

</div>

@JLeandroCorre Have you tried looking at _Last Activity Date_ as a way to update your deals instead of _Last Modified Date_? I know I found that _Last Modified Date_ was updated any time the slightest property changed in the deal, whereas _Last Activity Date_ updated only when a significant change was made. I may have those backwards, as it’s been a while since I’ve played with it. It’s worth taking a look at though.

---

<div class="post-metadata">

**Author:** ![jpsanchez](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jpsanchez/32/106486_2.png) [@jpsanchez](https://community.hubspot.com/u/jpsanchez)\
**Post date:** [July 1, 2022, 3:47am UTC](https://community.hubspot.com/t/updating-data-to-sql-server-through-certain-deal-properties-update-date/59645/5 "2022-07-01T03:47:40Z")

</div>

Hi,

I will suggest another walk arround.

Instead of your approuch ( focus in SEARCH API request). I will suggest:

- CREATE A dynamic List within HUBSPOT with the parameters of modify deal properties as you mention.
- USE GET RECENTLY ADDED CONTACTS FROM A LIST API ( documentation here [https://legacydocs.hubspot.com/docs/methods/lists/get\_list\_contacts\_recent?\_ga=2.142217394.1273508200.1656146462-1013658691.1651125723](https://legacydocs.hubspot.com/docs/methods/lists/get_list_contacts_recent?_ga=2.142217394.1273508200.1656146462-1013658691.1651125723))
- Remember you should need to transform the payload before inject in SQL ( There is a ETL process on this)

This API CALL will For a given HubID and a given list, return contacts that have been recently added to that list, starting with the most recently added contact and pageing backwards. A paginated list of contacts will be returned to you, with a maximum of 100 contacts per page, as specified by the “count” parameter.

To this i will call it **“jiu jitsu”. ( use hubspot on your side Vs try to do all outside HubSpot)**

Please let me know if it works or you need help with it bro!

Best

JP

😉

---

<div class="post-metadata">

**Author:** ![Jaycee\_Lewis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jaycee_lewis/32/61352_2.png) [@Jaycee\_Lewis](https://community.hubspot.com/u/Jaycee_Lewis)\
**Post date:** [July 1, 2022, 4:35pm UTC](https://community.hubspot.com/t/updating-data-to-sql-server-through-certain-deal-properties-update-date/59645/6 "2022-07-01T16:35:03Z")

</div>

Thank you, @jpsanchez 🙌 – Jaycee
