# Return data of modified fields within pipeline

**URL:** <https://community.hubspot.com/t/return-data-of-modified-fields-within-pipeline/11515>\
**Category:** APIs & Integrations\
**Tags:** object\
**Created:** [November 14, 2018, 4:05pm UTC](https://community.hubspot.com/t/return-data-of-modified-fields-within-pipeline/11515 "2018-11-14T16:05:15Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![latika\_karnani](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/latika_karnani/32/84176_2.png) [@latika\_karnani](https://community.hubspot.com/u/latika_karnani)\
**Post date:** [November 14, 2018, 4:05pm UTC](https://community.hubspot.com/t/return-data-of-modified-fields-within-pipeline/11515/1 "2018-11-14T16:05:15Z")

</div>

[

 ![](https://d2qpr2jzcazej7.cloudfront.net/original/3X/f/3/f364b8a72e6c9e30c107b6df07cb267ab7f710dd.png)

pipelineapi.PNG3201x1690 113 KB

]([https://community.hubspot.com/legacyfs/online/uploads/default/original/2X/3/3f581009515a8a6eb6cd15b918814da1075301ae.png](https://community.hubspot.com/legacyfs/online/uploads/default/original/2X/3/3f581009515a8a6eb6cd15b918814da1075301ae.png))

Inside deals, we have sales pipeline. With the API URL [https://api.hubapi.com/deals/v1/pipelines](https://api.hubapi.com/deals/v1/pipelines),  
I just get the structure of the pipeline, i.e. we have Targets, Warm leads, basic subscription, proposals..etc.  
But it doesn’t return the data of the companies, that are listed within the pipeline.

Precisely I need the names of the companies, when deals were changed.

For example in this month, 5 companies were moved from basic to proposal. I want to get the names of those companies.

How can we do this?

---

<div class="post-metadata">

**Author:** ![IsaacTakushi](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/isaactakushi/32/70387_2.png) [@IsaacTakushi](https://community.hubspot.com/u/IsaacTakushi)\
**Post date:** [November 16, 2018, 7:03pm UTC](https://community.hubspot.com/t/return-data-of-modified-fields-within-pipeline/11515/2 "2018-11-16T19:03:03Z")

</div>

Welcome, [@latika.karnani](https://community.hubspot.com/u/latika.karnani),

The [Deal Pipelines API](https://developers.hubspot.com/docs/methods/deal-pipelines/get-all-deal-pipelines) is deprecated, so I recommend using the [CRM Pipelines API](https://developers.hubspot.com/docs/methods/pipelines/pipelines_overview) going forward.

That said, neither of these pipeline APIs will return data about companies — they will only return data about pipelines. You must use a couple different APIs because pipelines, companies, and deals are different objects.

The [Get recently modified deals](https://developers.hubspot.com/docs/methods/deals/get_deals_modified) endpoint, however, returns `associatedCompanyIds`. You can then use these `companyId` values to get the company `name` property value from [this Companies API endpoint](https://developers.hubspot.com/docs/methods/companies/get_company).

---

<div class="post-metadata">

**Author:** ![latika\_karnani](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/latika_karnani/32/84176_2.png) [@latika\_karnani](https://community.hubspot.com/u/latika_karnani)\
**Post date:** [November 19, 2018, 2:55pm UTC](https://community.hubspot.com/t/return-data-of-modified-fields-within-pipeline/11515/3 "2018-11-19T14:55:31Z")

</div>

Another question,

[

 ![](https://d2qpr2jzcazej7.cloudfront.net/original/3X/5/7/573754478b3ec3b3483996dbf1ebb9390ee363bd.png)

image.png1097x590 26 KB

]([https://community.hubspot.com/legacyfs/online/uploads/default/original/2X/5/573754478b3ec3b3483996dbf1ebb9390ee363bd.png](https://community.hubspot.com/legacyfs/online/uploads/default/original/2X/5/573754478b3ec3b3483996dbf1ebb9390ee363bd.png))

Even if I am able to extract the associated company IDs of modified deals like this, how will I dynamically put those IDs in the Company API endpoint which goes in data source?

---

<div class="post-metadata">

**Author:** ![latika\_karnani](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/latika_karnani/32/84176_2.png) [@latika\_karnani](https://community.hubspot.com/u/latika_karnani)\
**Post date:** [November 18, 2018, 6:15pm UTC](https://community.hubspot.com/t/return-data-of-modified-fields-within-pipeline/11515/4 "2018-11-18T18:15:38Z")

</div>

Awesome. this gives me a great start. Thank you Issac. I have one question regarding this. If I want [https://api.hubapi.com/deals/v1/deal/recent/modified&since=x](https://api.hubapi.com/deals/v1/deal/recent/modified&since=x)  
where x would be present - 30 days, how do we do this in unix time format here?

---

<div class="post-metadata">

**Author:** ![IsaacTakushi](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/isaactakushi/32/70387_2.png) [@IsaacTakushi](https://community.hubspot.com/u/IsaacTakushi)\
**Post date:** [November 20, 2018, 6:05pm UTC](https://community.hubspot.com/t/return-data-of-modified-fields-within-pipeline/11515/5 "2018-11-20T18:05:14Z")

</div>

Hi [@latika.karnani](https://community.hubspot.com/u/latika.karnani),

For your first question, you could calculate that timestamp by using a function like [`Date.now()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/now) and then subtracting `2592000000`, which is 30 days in milliseconds. You would then use this resulting timestamp as the value for `since`.

I’m not sure what you mean by your second question. If you get all the company IDs, you can use a `for` loop to loop through every ID returned, store the value(s) in a variable and then use that variable to populate the request URL for [this endpoint](https://developers.hubspot.com/docs/methods/companies/get_company). If the `for` loop is built correctly, it should call the endpoint for every company ID. Each request will return data for that company record, from which you can retrieve the value of the `name` property. You can then surface the company name so that users know which companies are associated with a deal.

---

<div class="post-metadata">

**Author:** ![latika\_karnani](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/latika_karnani/32/84176_2.png) [@latika\_karnani](https://community.hubspot.com/u/latika_karnani)\
**Post date:** [November 26, 2018, 3:23pm UTC](https://community.hubspot.com/t/return-data-of-modified-fields-within-pipeline/11515/6 "2018-11-26T15:23:02Z")

</div>

Hi Isaac,  
I understand the process. Have you worked with Klipfolio before?  
I don’t think we can pass a value in the API URI for since=,  
nor can we loop through the results in a variable and assign the value in the URL request for the endpoint.

---

<div class="post-metadata">

**Author:** ![IsaacTakushi](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/isaactakushi/32/70387_2.png) [@IsaacTakushi](https://community.hubspot.com/u/IsaacTakushi)\
**Post date:** [November 26, 2018, 7:55pm UTC](https://community.hubspot.com/t/return-data-of-modified-fields-within-pipeline/11515/7 "2018-11-26T19:55:17Z")

</div>

Hi [@latika.karnani](https://community.hubspot.com/u/latika.karnani),

I have only worked with Klipfolio in [this limited capacity](https://integrate.hubspot.com/t/unable-to-use-the-analytics-data-for-specific-objects-api-in-klipfolio/14157).

Why don’t you believe you can populate timestamps in a request URL and then loop through the results?

Both of these are possible (see [this discussion](https://salesforce.stackexchange.com/questions/128685/how-to-give-date-and-time-values-in-request-body-using-postman) and [this thread](https://stackoverflow.com/questions/733314/jquery-loop-over-json-result-from-ajax-success), for example), so please be specific with the issues you are encountering.

---

<div class="post-metadata">

**Author:** ![latika\_karnani](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/latika_karnani/32/84176_2.png) [@latika\_karnani](https://community.hubspot.com/u/latika_karnani)\
**Post date:** [November 30, 2018, 4:40pm UTC](https://community.hubspot.com/t/return-data-of-modified-fields-within-pipeline/11515/8 "2018-11-30T16:40:04Z")

</div>

Got it. Thanks Issac.  
If anyone in future reading this,  
check this out [https://support.klipfolio.com/hc/en-us/articles/216182487-MAP-function](https://support.klipfolio.com/hc/en-us/articles/216182487-MAP-function)
