# How to get newly added feature id?

**URL:** <https://community.thinkgeo.com/t/how-to-get-newly-added-feature-id/8359>\
**Category:** MVC\
**Created:** [January 11, 2017, 11:23am UTC](https://community.thinkgeo.com/t/how-to-get-newly-added-feature-id/8359 "2017-01-11T11:23:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![reza\_assar](https://community.thinkgeo.com/letter_avatar_proxy/v4/letter/r/71e660/32.png) [@reza\_assar](https://community.thinkgeo.com/u/reza_assar)\
**Post date:** [January 11, 2017, 11:23am UTC](https://community.thinkgeo.com/t/how-to-get-newly-added-feature-id/8359/1 "2017-01-11T11:23:51Z")

</div>

I use `string strId=layer.EditTools.Add(newFeature);` to add a new feature into .shp file.  
returning `strId` is something like `"wer234 wet345 ert456 er345"`. but when i use `GetAllFeatures()` method, It turns out that the real inserted id for this feature is a string digit like `251`.  
Is there a way to retrieve real inserted id of the feature when i just added it?

---

<div class="post-metadata">

**Author:** ![Ethan](https://community.thinkgeo.com/user_avatar/community.thinkgeo.com/ethan/32/19964_2.png) [@Ethan](https://community.thinkgeo.com/u/Ethan)\
**Post date:** [January 12, 2017, 5:22am UTC](https://community.thinkgeo.com/t/how-to-get-newly-added-feature-id/8359/2 "2017-01-12T05:22:16Z")

</div>

Hi Reza,

If you view the API you can see the comment for it: This string is the ID that will uniquely identify this Feature while it is in a transaction.

So this id is not the real id for the added feature.

You can get the feature from layer again and know its id.

Regards,

Don
