Turned out that there are affiliations without ID. So we decided to store those affiliations with ID = first 50 characters of affiliation name.