How can I get the 'id' field shown when I print a FeatureCollection in Google Earth Engine? I tried get('id') or get('system:index') but it didn't work (returns null).

2 Answers 2


Even though "id" is listed, it's actually "system:id" internally

    // import points as FC 
    var myPoints = ee.FeatureCollection("users/me/important/myFC"); 
    // get the system:id and convert to string
    // note this is actually an object on the server
    var sysID_serverObj = ee.String(myPoints.get("system:id"));
    // getInfo() converts to string on the server
    var sysID_serverStr = sysID_serverObj.getInfo()
    // cut the string down for the fileName needed
    var fileName = sysID_serverStr.slice(7,100); 

More info on client vs server handling of objects here: https://developers.google.com/earth-engine/client_server


Properties that are associate with FeatureCollections and Features within that collection should not be confused, they can have two seperate sets of properties. Earth Engine is returning null when you try to get that property from the FC because it does not exist (even though individual features may have it). You can try explicitly setting the property on the FeatureCollection that you want using the .set() method.

var len = table.toList(10000).length().subtract(1)
var idList = ee.List.sequence(0,len)

var tableWithId = table.set('id',idList)
  • Thanks for reply Kel, but I mean the 'id' field that is shown under collection name after type, not its properties. How can I get this id? ImageCollection LANDSAT/LE07/C01/T1_SR (7 elements) type: ImageCollection id: LANDSAT/LE07/C01/T1_SR version: 1544793856359967 bands: [] features: List (7 elements) properties: Object (20 properties)
    – Shahriar49
    Dec 14, 2018 at 21:44
  • Oh, sorry. For whatever reason I thought you meant from a FeatureCollection. I don't think you can get the ID of the ImageCollection from the variable. You can look up the collection IDs using the Earth Engine Data Catalog though. Dec 19, 2018 at 2:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.