Product Information
Importing attachments to SAP SuccessFactors using Integration Center
I have been part of SAP Cloud HCM Integration team since I joined SAP in 2014. After working on couple of integrations between SAP Successfactors and third party vendors, I started working on Integration Center. I have been part of Integration Center development team since the project started and have seen Integration Center grow from a proof of concept to a Go-To tool for lot of customers and partners for most integration needs of Successfactors. The blog talks about Attachment Import feature of Integration Center and provides a step-by-step guide to solve some of the use cases involving Attachments in Successfactors.
Integration Center
The Integration Center enables HR business analysts to build, run, schedule and monitor simple integrations. Integration Center helps building integrations quickly and easily through a guided workflow.
Importing Attachments to SuccessFactors
Introduction
With b1708 release, Integration Center started supporting import of attachments as a Beta feature. There are certain entities in SuccessFactors which hold attachment data. You can use integration center inbound feature to import attachments to such entities.
Pre-requisites
- Integration Center is enabled in the SuccessFactors instance
- Basic knowledge of how to use Integration Center
Use case 1 (Uploading profile pictures of the users)
There are a set of users created in SuccessFactors system. An admin has photos which need to be uploaded in the system as profile pictures of the users.
Steps
-
Preparing a CSV file containing master data
Prepare a CSV file which contains data to be imported. For uploading photos of the users, the file should contain user id of the users and name of the file to be uploaded as profile picture for the user. In the CSV file, the first row is treated as header. Following is a snapshot of sample data:
-
Uploading files to SFTP server
The CSV file prepared in Step1 should be uploaded in a folder on SFTP server. Also the corresponding image files should uploaded in the same SFTP folder. For the above sample data, along with the CSV file, cgrant_photo.png, markhoff.jpg and john.png should be uploaded on the SFTP server.
-
Creating integration with Integration Center
- Login to SuccessFactors application and Navigate to Integration Center
- Create a new CSV inbound integration with starting entity ==> Photo
- Navigate to Configure Fields tab and upload the sample CSV file prepared in Step1
- Define mapping between source fields and target fields
- photoType <– Default value (1)
- photo type 1 refers to master copy of user profile photo
- userId <– Column 1 (UserId)
- photo <– Column 2 (Photo)
- This field is of type Edm.Binary. This is the field which holds the file content. While defining mapping, this field should be mapped to name of the image file to be uploaded.
- photoName <– Column 2 (Photo)
- This field holds name of the photo file.
- photoType <– Default value (1)
- Navigate to Source Settings tab and specify SFTP details.
- Enter server address and credentials and folder location of the SFTP server where the CSV file and photos are uploaded in Step2
- Enter name of the CSV file (without file extension) in the File Name Prefix field
- Chose file extension as csv
- Specify Processing Folder where the files should be moved post-processing
- Save the integration and click on Run Now to test the integration
-
Verify the integration
Once the integration has run you can go to user profiles and verify that the photos are uploaded
Use Case 2 (Uploading resume and other documents to Job Application)
The admin needs to upload a set of Job Applications in the SuccessFactors system. The job applications have corresponding resumes and cover letters which should also be uploaded in the system.
The steps to implement this use case are similar to the steps explained for previous use case. A CSVfile containing job application data along with file names of resume and cover letters need to be prepared. The CSV file, cover letters and resumes should be uploaded on an SFTP server.
For this use case we need to select Job Application as starting entity and define mappings for cover letter and resume.
Additional details
- Deep Write
- The inbound integration with Integration Center also supports deep writes. So, you can create an integration with Job Application as main entity and define mapping for cover letter, resume and other associations. Because of this feature, single integration can upload Job Applications, upload resumes and cover letters and associate them with corresponding Job Application records.
- Defining Mapping
- Since we are starting with Job Application as main entity, to define mappings for Cover letter and Resume, expand the node with Cover Letter ( or Resume ) and define mapping for fields under it.
-
- Cover Letter > fileContent <– CSV column holding name of the cover letter
- Cover Letter > fileName <– CSV column holding name of the cover letter
- Cover Letter > module <– Default value (RECRUITING )
- Resume > fileContent <– CSV column holding name of the resume
- Resume > fileName <– CSV column holding name of the resume
- Resume > module <– Default value (RECRUITING ) ( Note: Please refer to API documentation for Attachment to find out valid module values.)
-
- Since we are starting with Job Application as main entity, to define mappings for Cover letter and Resume, expand the node with Cover Letter ( or Resume ) and define mapping for fields under it.
Once the mapping is defined, specify the Source Settings, save and test the integration. On running the integration we should be able to see the job application created in the system along with Cover letter and Resume.
Attachments being one of the most important entity in SuccessFactors data model, this Integration Center feature can help simplify lot of Integration use cases around Attachments. The blog provides steps to solve some of those use cases. You can follow similar steps and solve many such integration use cases 🙂
Known Limitations
As of now, this solution doesn’t work for importing attachments to custom MDF objects.
References
Job Application API Documentation
Great blog,
And just thought to add one point for the both integration you need UTF-8 format CSV file.
In the second point you have mentioned the FILE NAME, can you give reference like what is the source of the file.
As in the Photo entity we have used SFTP where we can keep the CSV FILE + Photos in folder from which we can extract and run integration.
If you explain the source of file name in attachment entity that will truly amazing.
Hope to see the response soon.
Regards,
Khan
Thanks for pointing out about the UTF-8 format.
Regarding source of file name:
The CSV file needs to have one column which holds name of the file which is to be uploaded for the corresponding record.
In the Photo example, the integration will look for a file with name cgrant_photo.png in the SFTP folder and upload it as a photo for user cgrant in the BizX. Similarly, file with name markhoff.jpg will be uploaded in the BizX system for user mhoff.
So, along with uploading files (photos in this case) to the SFTP server, the file names should be added to the CSV file to the corresponding rows.
Hope this helps.
Do write back if there are any further queries.
Regards,
Twinkle
Hi Twinkle,
Thanks for the information, am trying to attach one document in custom API. Here are following up the 3 fields that you have said and those fields that are directed in document on attachment api.
But its still not getting upserted am attaching the mapping screen shot kindly suggest on the same.
Regards,
Ferozkhan
Great Blog, thanks for sharing this one.
I have some doubts, What is max size for both import file.
Is there any limitation for size of the file?
Thanks
Sid
Hi Sid,
kindly reffer to this KBA in the below link, its 10MB max.
https://apps.support.sap.com/sap/support/knowledge/public/en/2087423
Regards,
Ferozkhan
Dear community,
uploading a photo/attachment is also possible via OData API and imho the easiest way compared to sFTP. As a customer using sFTP is not really easy. Most of the companies are able to use/serve webservices and due to this ... uploading a photo via OData for SuccessFactors can be achieved via:
E.g. in DC12 this would be: https://api12preview.sapsf.eu/odata/v2/upsert?$format=json
Raw Request for updating two profile pictures:
Best regards,
Chris
Hi Chris,
I have used this method for Bio Metric integration's, here the requirement that am looking as uploading the documents that generated from a 3rd party payroll system and downloaded into SFTP server.
From there it have to get uploaded to a custom portlet, where there is field with data type as ATTACHMENT.
After that End User are able to look into the attached PDF's and will download if needed.
Here converting the the doc and then updating the service is bit lengthy process.
if you can check and suggest of ATTACHMENT entity that will be great help.
Appreciate your help, looking forward for your reply.
Regards,
Feroz khan
Hey Chris, Can this be done to upload documents / resumes to Background elements in People Profile?
Regards,
Shweta Thakkar
Unfortunately there is no entity in OData API for background elements. Therefore you need to use extended employee import feature (Import Extended User Information -> Background Information).
Hi Twinkle,
I am trying to use this method to upload documents against People Profile in Background elements. But somehow, the document does not get posted against the people profile. Have you done it? Could you guess what could be the reason for it?
Hi Shweta,
I haven't tried for Background elements. But a general rule is, Integration Center ( as well as the method suggested by Chris ) would work if the corresponding API allows import of attachment. For Photo and Job Application, the API supports create/upsert of Attachment fields and that is why it works.
I went through the API documentation for Background entities:
https://help.sap.com/viewer/28bc3c8e3f214ab487ec51b1b8709adc/latest/en-US/011e693e3a00486392c0924e9748bbbc.html
The document says "The API doesn’t support any operations on attachment data-fields.". So, if the API doesn't support it, it won't be possible with Integration Center as well.
(OData API Data Dictionary is a good way to identify what operations are supported for what fields of an entity. Also, while creating an Integration using Integration Center, you'll see only the fields which support the corresponding operation, so if a field is not visible when you select operation as Upsert, then it means that the API doesn't support Upsert operation for that field.)
Regards,
Twinkle
Hi Twinkle,
Thank you so much for your response. I also checked the same. Do you think there is any way to upload documents in bulk against the user ids for People Profile?
Thanks
Regards,
Shweta
Hi Shweta,
Since, it is not supported by the API itself, I don't see any method which depends on the APIs to import data would work. You might want to check with the People Profile team itself if they have any other mechanism available.
Regards,
Twinkle
Would this feature also work with MDF entities? Please advise. Thanks!
The doesn't work for MDF entities as of now, due to a limitation on the MDF APIs. There is an internal ticket raised to MDF team for the enhancement to API. This feature would start working for MDF once that ticket is closed by the MDF team.
Hi there,
is there a way to use the integration center to upload data into an background element that is linking to an document that has already been uploaded to the SF instance and can be seen in "manage documents"?
Thanks,
Mathias
Hi Mathias,
Do you mean you want to upload some data which is not document/attachment? Can you share one of the entity/object name to which you want to upload data?
In general, Integration Center can be used to upload files/documents as well as records to a particular entity/object in SF. https://help.sap.com/viewer/60ba370328e0485797adde67aee846a0/2005/en-US/69b40839604c415c9aa79e9261160a31.html
Hi all!,
I am trying to use this method, through Integration Center, to upload attached documents against FOJobCode, from SFTP to SuccessFactors inbound integration. A cust field type “attachment” was added in FOJobCode object definition.
But the Integration Process always gives me a Warning “Reason: is not allowed the edition for ”cust_AttachField”…
Could you help me to fix it? What is the reason for this? Is this method allowed for FO objects? Thanks!