def _getIDfromIndex(childrenFolders, entityType, index):
  """ Get the folder_id for a subfolder based on its index in the folder.
    childrenFolders -- Dictionary specifying children of the folder.
    entityType -- folder or item.
    index -- Index of the item in the folder to find the id.
    Returns the integer ID."""
  entity_key = entityType + "s"
  entity = childrenFolders[entity_key]
  id_key = entityType + "_id"
  ID = entity[index][id_key]
  return ID