Sunday, October 12, 2025

Mass export employee photos

Recently was trying to figure out how to mass download/export employee photos from PeopleSoft and followingis what I came up with. It works but the exported image quality is not that great. We are using the delivered application engine HR_EMPLPHOTO to mass import picutes in. The photos are loaded to PS_EMPL_PHOTO table and it creates four photo sizes - CARD, LIST, ORCH and PAGE. The CARD one is the best in terms of picture quality.

The basic idea is to read this table and write the contents to a file. Based on the upload process I know that the picture file format is JPG. The raw image data is stored in the EMPLOYEE_PHOTO field, but we cannot just select this field. I am looping through the employee population, fetching the data and storing it in the record object and then using the WriteRaw method of the File class to write the image to a file. 


Local string &emplid, &filename;
Local Record &imageRec;
Local SQL &imageSQL;

&imageRec = CreateRecord(Record.EMPL_PHOTO);
&imageSQL = CreateSQL("SELECT EMPLID, PHOTO_SIZENAME, PHOTO_IMGNAME, EMPLOYEE_PHOTO, PSIMAGEVER FROM PS_EMPL_PHOTO WHERE EMPLID = :1 AND PHOTO_SIZENAME = 'CARD'", &emplid);

If &imageSQL.Fetch(&imageRec) Then
   &imageFile = GetFile(&filename, "W", %FilePath_Absolute);
   &imageFile.WriteRaw(&imageRec.EMPLOYEE_PHOTO.Value);
   &imageFile.Close();
End-If;

Monday, January 6, 2025

Taleo Web API - managing user groups in a user profile

I have been using Taleo (or Oracle's) SOAP based web API to transmit data to Taleo from PeopleSoft. As part of this service I am creating/updating user profiles in Taleo based on actions taken in PeopleSoft. Recently received a request to manage/update the user groups associated with a user profile based on action done in PeopleSoft.

I am running PeopleTools 8.61.x, HCM 9.2 but this should be possible as long as you can make a SOAP call out from PeopleSoft. 

User Groups are part of the UserAccount construct as shown below. Following is a simple construct to pull up or search for an user account and then assign a user group to the user account.

<?xml version="1.0" encoding="UTF-8"?> <UserAccount> <Loginname searchType="search" searchTarget="../../.." searchValue="user@emaildomain.com" /> <Groups> <Group> <Name searchTarget="." searchType="search" searchValue="Group-Code-01" /> </Group> </Groups> </UserAccount>
To delete all the User Groups assigned to an user the request XML will be like below.

<?xml version="1.0" encoding="UTF-8"?> <UserAccount> <Loginname searchType="search" searchTarget="../../.." searchValue="user@emaildomain.com" /> <Groups action="reset" /> 
</UserAccount>
  
To delete only a specific user group from the list of assigned user groups on an user profile the request will be like below.

<?xml version="1.0" encoding="UTF-8"?> <UserAccount> <Loginname searchType="search" searchTarget="../../.." searchValue="user@emaildomain.com" /> <Groups> <Group action="remove"> <Name searchType="search" searchTarget="." searchValue="Group-Code-01" /> </Group> </Groups> </UserAccount>

One can combine the above actions in a single request like removing all or one user group and assigning a new user group.