I have been trying to import an employee data package via the Data management API, with the following content:
Manifest.xml
<DataManagementPackageManifest xmlns:i="">www.w3.org/.../XMLSchema-instance" xmlns="">schemas.microsoft.com/.../DataManagement"> <DefinitionGroupName>Descriptionc</DefinitionGroupName> <Description></Description> <PackageEntityList> <DataManagementPackageEntityData> <DefaultRefreshType>FullPush</DefaultRefreshType> <Disable>false</Disable> <EntityMapList> <EntityMap> <ArrayIndex>0</ArrayIndex> <EntityField>PERSONNELNUMBER</EntityField> <EntityFieldConversionList i:nil="true"></EntityFieldConversionList> <IsAutoDefault>false</IsAutoDefault> <IsDefaultValueEqualNull>false</IsDefaultValueEqualNull> <IsAutoGenerated>true</IsAutoGenerated> <UseTextQualifier>false</UseTextQualifier> <XMLField>PERSONNELNUMBER</XMLField> </EntityMap> <EntityMap> <ArrayIndex>0</ArrayIndex> <EntityField>EMPLOYMENTLEGALENTITYID</EntityField> <EntityFieldConversionList i:nil="true"></EntityFieldConversionList> <IsAutoDefault>false</IsAutoDefault> <IsAutoGenerated>false</IsAutoGenerated> <IsDefaultValueEqualNull>false</IsDefaultValueEqualNull> <UseTextQualifier>false</UseTextQualifier> <XMLField>EMPLOYMENTLEGALENTITYID</XMLField> </EntityMap> <EntityMap> <ArrayIndex>0</ArrayIndex> <EntityField>FIRSTNAME</EntityField> <EntityFieldConversionList i:nil="true"></EntityFieldConversionList> <IsAutoDefault>false</IsAutoDefault> <IsAutoGenerated>false</IsAutoGenerated> <IsDefaultValueEqualNull>true</IsDefaultValueEqualNull> <UseTextQualifier>false</UseTextQualifier> <XMLField>FIRSTNAME</XMLField> </EntityMap> <EntityMap> <ArrayIndex>0</ArrayIndex> <EntityField>NAMEALIAS</EntityField> <EntityFieldConversionList i:nil="true"></EntityFieldConversionList> <IsAutoDefault>false</IsAutoDefault> <IsAutoGenerated>false</IsAutoGenerated> <IsDefaultValueEqualNull>true</IsDefaultValueEqualNull> <UseTextQualifier>false</UseTextQualifier> <XMLField>NAMEALIAS</XMLField> </EntityMap> <EntityMap> <ArrayIndex>0</ArrayIndex> <EntityField>EMPLOYMENTSTARTDATE</EntityField> <EntityFieldConversionList i:nil="true"></EntityFieldConversionList> <IsAutoDefault>false</IsAutoDefault> <IsAutoGenerated>false</IsAutoGenerated> <IsDefaultValueEqualNull>false</IsDefaultValueEqualNull> <UseTextQualifier>false</UseTextQualifier> <XMLField>EMPLOYMENTSTARTDATE</XMLField> </EntityMap> <EntityMap> <ArrayIndex>0</ArrayIndex> <EntityField>EMPLOYMENTENDDATE</EntityField> <EntityFieldConversionList i:nil="true"></EntityFieldConversionList> <IsAutoDefault>false</IsAutoDefault> <IsAutoGenerated>false</IsAutoGenerated> <IsDefaultValueEqualNull>false</IsDefaultValueEqualNull> <UseTextQualifier>false</UseTextQualifier> <XMLField>EMPLOYMENTENDDATE</XMLField> </EntityMap> </EntityMapList> <EntityName>Employee</EntityName> <EntityTransformList i:nil="true"></EntityTransformList> <ExcelSheetName></ExcelSheetName> <ExecutionUnit>1</ExecutionUnit> <FailExecutionUnitOnError>true</FailExecutionUnitOnError> <FailLevelOnError>true</FailLevelOnError> <InputFilePath>Data.csv</InputFilePath> <LevelInExecutionUnit>1</LevelInExecutionUnit> <RunBusinessLogic>true</RunBusinessLogic> <RunBusinessValidation>true</RunBusinessValidation> <SampleFilePath></SampleFilePath> <SequenceInLevel>1</SequenceInLevel> <SourceFormat>CSV-Unicode</SourceFormat> <TargetEntity>HcmEmployeeEntity</TargetEntity> <ValidationStatus>Yes</ValidationStatus> </DataManagementPackageEntityData> </PackageEntityList> <ProjectCategory>0</ProjectCategory> <RulesData i:nil="true"></RulesData> </DataManagementPackageManifest> |
Data.csv
EMPLOYMENTLEGALENTITYID,FIRSTNAME,NAMEALIAS,EMPLOYMENTSTARTDATE,EMPLOYMENTENDDATE dat,Test987650,Test987654,2020-02-02,2024-02-02 dat,Test987651,Test987653,2020-02-02,2024-02-02 |
It always fails I believe because PersonnelNumber is not specified (if I specify PersonnelNumber, it imports succesfully), but this does not make sense to me.
Are clients supposed to generate PersonnelNumber manually? How do we guarentee that the PersonnelNumber we generate is unique?
Does anyone have a working data package for importing employees?
Lastly, I noticed that there is a AutoGenerate field in the field maps (it has no effect as far as I have tested), but is there any API to check if a field is auto-generated or not?