convert related entity to its id in function convert-entity-to-map