# Getting unique stats from Form Submission API

**URL:** <https://community.hubspot.com/t/getting-unique-stats-from-form-submission-api/16377>\
**Category:** APIs & Integrations\
**Tags:** developer-tools, forms\
**Created:** [September 23, 2019, 11:45am UTC](https://community.hubspot.com/t/getting-unique-stats-from-form-submission-api/16377 "2019-09-23T11:45:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![zohaib](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/zohaib/32/52876_2.png) [@zohaib](https://community.hubspot.com/u/zohaib)\
**Post date:** [September 23, 2019, 11:45am UTC](https://community.hubspot.com/t/getting-unique-stats-from-form-submission-api/16377/1 "2019-09-23T11:45:30Z")

</div>

Hi All

We are running into a problem, we have to migrate form submissions from Hubspot to Dynamics 365, but we are unable to find any unique field or column from hubspot on which we can set up a lookup and get just new records. We are usnig this API

Get submissions for a form

[https://api.hubapi.com/form-integrations/v1/submissions/forms/583d14ff-91af-403d-b94a-c8b5d954da6f?hapikey=demo](https://api.hubapi.com/form-integrations/v1/submissions/forms/583d14ff-91af-403d-b94a-c8b5d954da6f?hapikey=demo)

Any help will appriciated.

Many Thanks

---

<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:** [September 23, 2019, 8:25pm UTC](https://community.hubspot.com/t/getting-unique-stats-from-form-submission-api/16377/2 "2019-09-23T20:25:49Z")

</div>

Hi, @zohaib.

To clarify, are you trying to filter the results from [this endpoint](https://developers.hubspot.com/docs/methods/forms/get-submissions-for-a-form) so that you don’t have to parse through _all_ submissions each time?

Could you record the last `submittedAt` timestamp you retrieve and then the next time you make a `GET` request, have your app stop calling when it sees the same `submittedAt` value?

Please let me know if I have misunderstood your question.

---

<div class="post-metadata">

**Author:** ![zohaib](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/zohaib/32/52876_2.png) [@zohaib](https://community.hubspot.com/u/zohaib)\
**Post date:** [September 24, 2019, 5:50am UTC](https://community.hubspot.com/t/getting-unique-stats-from-form-submission-api/16377/3 "2019-09-24T05:50:11Z")

</div>

hi @IsaacTakushi

Thank you so much for your response.

1- Yes,I am using your mentioned endpoind. We have to get the submissions on daily basis, first time i will move all the submissions then next day i need to move only new submissions. But there is an issue

i am trying to get the stats using Json Source in SSIS (Sql Server Integration Services), it is providing me three different outputs, Issue is timestamp is in different Output Object and the my required fields in other output object, there is not any same column in both obects on which i can merge them, please see attached.

 ![Capture12.PNG](https://d2qpr2jzcazej7.cloudfront.net/original/3X/3/1/31b5e77809be85ef49f08e305e8c7ab739d1f152.png)

 ![Capture14.PNG](https://d2qpr2jzcazej7.cloudfront.net/original/2X/1/12bbcdc3fe13e68e57c8b04bf1bc6b8a529f6787.png)

2- Yes, i can save submittedAt timestamp, if i can get the submittedAt timestamp and other fields in the same output object.

Please ask me if there is anything need to more explain.

Thanks

---

<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:** [September 24, 2019, 1:29pm UTC](https://community.hubspot.com/t/getting-unique-stats-from-form-submission-api/16377/4 "2019-09-24T13:29:41Z")

</div>

Hi, @zohaib.

Thank you for clarifying. I believe I now grasp the issue: the `submittedAt` values are going into different tables than the submission fields and you can’t use a [`MERGE`](https://www.essentialsql.com/introduction-merge-statement/) statement since you have no primary key to tie the two tables together. Is that correct?

Assuming a single form submission produces a table containing the `submittedAt` timestamp and another containing the submission `values`, could you use an [`INSERT INTO SELECT`](https://www.w3schools.com/sql/sql_insert_into_select.asp) statement to copy the `submittedAt` timestamp column into the table containing the submission `values`?

According to [this article](https://www.w3schools.com/sql/sql_insert_into_select.asp), this statement does not required a primary key to match tables.
