Importing only one user from DB to Saviynt

Sekhar
New Contributor
New Contributor

I am importing 5 users from DB connection, but only one user is importing to saviynt.

i am using query like select employeecode,firstname,lastname,email,status from employee where employeecode in (111,112,113,114,115)

Only 1st user(111) is importing.

I want to import all users from DB what we give in where clause.

Can you please advise for me.

14 REPLIES 14

pmahalle
Valued Contributor II
Valued Contributor II

What did you mapped to username? Are you having same value for all five users assigning to username attribute. 

Can you share the user import xml.


Regards,

Pandharinath Mahalle(Paddy)
If this reply answered your question, please Accept it As Solution to help others who may have a similar problem.

Hi @pmahalle ,

we mapped username to employeecode. Doesnt use same values for 5 users.

Can you see attached file.

 

Thanks,

Sekhar

pmahalle
Valued Contributor II
Valued Contributor II

Hi @Sekhar ,

Is xeuserid different for all the users? Also I can see you mapped manager, manager value coming as emp id of the manager?

Can you map manager field to owner instead of manager in Saviynt like below and try:

<mapfield saviyntproperty="owner" sourceproperty="Manager" type="character"></mapfield>

If you are still facing the issue, please provide the logs.


Regards,

Pandharinath Mahalle(Paddy)
If this reply answered your question, please Accept it As Solution to help others who may have a similar problem.

hi @pmahalle 

I tried what you said, still importing only one user. I am getting below error in logs.

ecm-worker-{"log":"2023-07-19 14:04:32,412 [quartzScheduler_Worker-6] DEBUG services.ImportSAvDataUserService - Not Importing user - either username attribute not found or if vendor is there then user doesnt have access to import the vendor 

Thanks,

Sekhar

pmahalle
Valued Contributor II
Valued Contributor II

Hi @Sekhar ,

When you executed the same query on target DB, you are getting desired results? Also, is xeuserid different for all the users?


Regards,

Pandharinath Mahalle(Paddy)
If this reply answered your question, please Accept it As Solution to help others who may have a similar problem.

Hi, @pmahalle 

We got desired results when i executed the same query in DB. xeuserid is the unique number, its is different for all users.

Thanks,

Sekhar

armaanzahir
Regular Contributor III
Regular Contributor III

Hi @Sekhar ,

 

Please set the uniquecolumnsascommaseparated as username instead of employeecode and try.

Does running the above query on the target provide you the desired results?

Also, there are many date mappings defined as character. Can you check their datatypes on the target and define the mappings accordingly.

Thanks,

Armaan

Regards,
Md Armaan Zahir

Hi, @armaanzahir 

I tried what you mentioned above, still getting same issue that is importing only one user.

 

Thanks,

Sekhar

Can you execute same query on target and share the output?

Thanks,
Devang Gandhi
If this reply answered your question, please click the Accept As Solution button to help future users who may have a similar problem.

Can you reshare query

Sekhar
New Contributor
New Contributor

Hi @rushikeshvartak ,

SELECT employeeid,employeecode,firstnames,lastname,Manager,ManagerUserID,EmployeeType,terminationdate,plannedterminationdate,IIF((CONVERT(date,terminationdate) >= CONVERT(date,getdate())),1,
IIF(CONVERT(date,terminationdate) is null,1,0)) as STATUSKEY,'OldUser' ExistingUser,IIF(datediff(day,getdate(),startdate) in(0,1,2),'ProvisionNow','') ProvisionNow,DisplayName,TerminationMonth,EmployeeStatusCode,Company,EmployeeClass, EmployeeStatusDescription,Country,DepartmentCode, state,Postcode,Address1,Address2,Address3,DepartmentName,WorkEmail,PreferredName,StartDate, JobCode,MobilePhone,Email,XEUserId,LocationCode, LocationName, WorkAreaCode,WorkAreaName,PositionCode, PositionName,'\\DBNAME\users\' as HomeDirectory,CountryCode from [TABLE] where employeecode in ('978114','978115','978116','978117','978118')

Thanks,

Sekhar

 

<dataMapping>
	<sql-query description="This is the Source DB Query" uniquecolumnsascommaseparated="username">
		<![CDATA[SELECT employeeid,employeecode,firstnames,lastname,Manager,ManagerUserID,EmployeeType,terminationdate,plannedterminationdate,IIF((CONVERT(date,terminationdate) >= CONVERT(date,getdate())),1,
IIF(CONVERT(date,terminationdate) is null,1,0))  as STATUSKEY,'OldUser' ExistingUser,IIF(datediff(day,getdate(),startdate)  in(0,1,2),'ProvisionNow','') ProvisionNow,DisplayName,TerminationMonth,EmployeeStatusCode,Company,EmployeeClass, EmployeeStatusDescription,Country,DepartmentCode, state,Postcode,Address1,Address2,Address3,DepartmentName,WorkEmail,PreferredName,StartDate, JobCode,MobilePhone,Email,XEUserId,LocationCode, LocationName, WorkAreaCode,WorkAreaName,PositionCode, PositionName,'\\DBNAME\users\' as HomeDirectory,CountryCode from [TABLE] where employeecode in ('978114','978115','978116','978117','978118');]]>
	</sql-query>
	<importsettings>
		<zeroDayProvisioning>true</zeroDayProvisioning>
		<userNotInFileAction>NOACTION</userNotInFileAction>
		<checkRules>true</checkRules>
		<buildUserMap>true</buildUserMap>
		<generateSystemUsername>true</generateSystemUsername>
		<generateEmail>true</generateEmail>
		<userReconcillationField>username</userReconcillationField>
	</importsettings>
	<mapper description="This is the mapping field for Saviynt Field name" defaultrole="ROLE_END_USER" dateformat="date">
		<mapfield saviyntproperty="username" sourceproperty="employeecode" type="character"></mapfield>
		<mapfield saviyntproperty="systemUserName" sourceproperty="xeuserid" type="character"></mapfield>
		<mapfield saviyntproperty="email" sourceproperty="workemail" type="character"></mapfield>
		<mapfield saviyntproperty="manager" sourceproperty="Manager" type="character"></mapfield>
		<mapfield saviyntproperty="employeeclass" sourceproperty="employeeclass" type="character"></mapfield>
		<mapfield saviyntproperty="customproperty14" sourceproperty="HomeDirectory" type="character"></mapfield>
		<mapfield saviyntproperty="state" sourceproperty="State" type="character"></mapfield>
		<mapfield saviyntproperty="customproperty25" sourceproperty="ExistingUser" type="character"></mapfield>
		<mapfield saviyntproperty="customproperty19" sourceproperty="ProvisionNow" type="character"></mapfield>
		<mapfield saviyntproperty="customproperty15" sourceproperty="Postcode" type="character"></mapfield>
		<mapfield saviyntproperty="employeeType" sourceproperty="EmployeeType" type="character"></mapfield>
		<mapfield saviyntproperty="customproperty1" sourceproperty="employeestatuscode" type="character"></mapfield>
		<mapfield saviyntproperty="customproperty2" sourceproperty="employeestatusdescription" type="character"></mapfield>
		<mapfield saviyntproperty="firstname" sourceproperty="firstnames" type="character"></mapfield>
		<mapfield saviyntproperty="lastname" sourceproperty="lastname" type="character"></mapfield>
		<mapfield saviyntproperty="displayname" sourceproperty="DisplayName" type="character"></mapfield>
		<mapfield saviyntproperty="preferedFirstName" sourceproperty="PreferredName" type="character"></mapfield>
		<mapfield saviyntproperty="startdate" sourceproperty="startdate" type="character"></mapfield>
		<mapfield saviyntproperty="enddate" sourceproperty="terminationdate" type="character"></mapfield>
		<mapfield saviyntproperty="customproperty17" sourceproperty="TerminationMonth" type="character"></mapfield>
		<mapfield saviyntproperty="statuskey" sourceproperty="statuskey" type="character"></mapfield>
		<mapfield saviyntproperty="departmentNumber" sourceproperty="DepartmentCode" type="character"></mapfield>
		<mapfield saviyntproperty="departmentname" sourceproperty="DepartmentName" type="character"></mapfield>
		<mapfield saviyntproperty="location" sourceproperty="LocationName" type="character"></mapfield>
		<mapfield saviyntproperty="companyname" sourceproperty="Company" type="character"></mapfield>
		<mapfield saviyntproperty="locationnumber" sourceproperty="LocationCode" type="character"></mapfield>
		<mapfield saviyntproperty="customproperty3" sourceproperty="WorkAreaCode" type="character"></mapfield>
		<mapfield saviyntproperty="customproperty4" sourceproperty="WorkAreaName" type="character"></mapfield>
		<mapfield saviyntproperty="jobCode" sourceproperty="PositionCode" type="character"></mapfield>
		<mapfield saviyntproperty="jobdescription" sourceproperty="PositionName" type="character"></mapfield>
		<mapfield saviyntproperty="phonenumber" sourceproperty="MobilePhone" type="character"></mapfield>
		<mapfield saviyntproperty="secondaryEmail" sourceproperty="Email" type="character"></mapfield>
		<mapfield saviyntproperty="country" sourceproperty="country" type="character"></mapfield>
		<mapfield saviyntproperty="customproperty13" sourceproperty="CountryCode" type="character"></mapfield>
		<mapfield saviyntproperty="termDate" sourceproperty="PlannedTerminationDate" type="date"></mapfield>
	</mapper>
	<after-import description="EMAIL,BATCH,SQL"></after-import>
</dataMapping>

 

Hi @rushikeshvartak ,

i tried with above query, but still importing one user from DB to saviynt.

Sekhar_0-1690869434033.png

Regards,

Sekhar.

pmahalle
Valued Contributor II
Valued Contributor II

Hi @Sekhar ,

From the summary screenshot above seems like 11 users got updated. Make sure all the users you want to be created have unique username in your target DB and not present in Saviynt already.


Regards,

Pandharinath Mahalle(Paddy)
If this reply answered your question, please Accept it As Solution to help others who may have a similar problem.