- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-30-2023 08:20 AM - edited ‎08-30-2023 11:06 PM
Hi Everyone!!
Using SuccessFactors Spoke (oData API), tried to pull data from Successfactors to Servicenow staging tables. I was successful to pull data for three tables. However, all my efforts are failing for Locations table. Copied the OOB flow designer and want result only for 3 fields as of now, External ID, name and country.
Somehow after making some code as commented, I was able to pull the information for External id and Name, however country details are not populating at all.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-31-2023 12:58 AM
@Gaurav Gupta3 This is not the issue from service now end .It is from success factor end .Because i just ran my OOB retrieve location action and in my payload i found the exact resource path like below.And also for few path i found country values as null and for few paths i got country codes correctly,
And this is the path i got in my flow execution record.Check if the same resource path you are getting in flow execution page.
FOLocation?$format=JSON&$expand=addressNavDEFLT/stateNav/picklistLabels
So in my ODATA dictionary model this path is there .But after seeing your error i think its clear that there is a data model change in SSF end .
Just check with SF admin whether they have this resource path or not.
Also see this article from SAP knowledge
centre
https://userapps.support.sap.com/sap/support/knowledge/en/3248664
This above error is for different path PerPersonal/middleName. but the issue is same as yours and the article says the cause might be due to field / property mentioned in the error being disabled.
See this below screenshot where i got FOCorporateAddressDEFLT path in my payload
So i feel in SSF this field FOCorporateAddressDEFLT/stateNav is disabled as per the article .
contact your SF admin and get it checked by showing them the payload that you are getting and also the error .
Hope this helps
Mark the answer correct if this helps you
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-30-2023 08:49 AM
1. Set Up an External Data Source:
In ServiceNow, you need to configure an external data source to connect to the SuccessFactors oData API.
- Navigate to "System Web Services" -> "External Data Sources."
- Create a new record for the SuccessFactors oData API connection.
- Configure the endpoint URL, authentication methods, and other necessary details.
2. Create Staging Tables:
You need staging tables in ServiceNow where you'll temporarily store the data before transforming and loading it into ServiceNow's main tables.
- Define the structure of the staging tables to match the data you'll be pulling from SuccessFactors.
3. Create a Transform Map:
A transform map defines how data from the external data source (SuccessFactors) is mapped to fields in ServiceNow.
- Navigate to "Import Sets" -> "Transform Maps."
- Create a new transform map and specify the source and target tables (staging tables and ServiceNow tables).
- Define the mapping between source and target fields, including any data transformations or scripts required.
4. Schedule Imports:
You can schedule regular imports to pull data from SuccessFactors into your ServiceNow staging tables.
- Navigate to "Scheduled Jobs" -> "Scheduled Script Executions."
- Create a new scheduled job that runs a script to perform the import.
- In the script, use the import API to trigger the import process using the external data source, transform map, and staging table.
Here's an example script that you might use in the scheduled job:
var dataSource = new GlideExternalDataSource('<data_source_name>');
var importSetTable = new GlideImportSet();
var importSet = importSetTable.createNew('u_import_set_name');
importSet.setDataSource(dataSource);
importSet.load();
var importSetRun = new GlideImportSetRun();
importSetRun.setImportSet(importSet);
importSetRun.run();
if (importSetRun.getStatistics().getRecordCount() == 0) {
gs.addErrorMessage('Import from SuccessFactors failed.');
}
if you get answer please mark helpful and accept solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-30-2023 11:27 PM
Thank you for the detailed response, however I am looking here for OOTB solution with respect to Successfactor spoke. This spoke is installed using the plugin and staging tables already get created, all that is already working fine. However, pulling data is an issue.
I know my question is missing some important content yesterday so I have added more information today.
Please go through and suggest.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-30-2023 09:05 AM
Hello @Gaurav Gupta3 ,
Are you using OOB spoke and OOB flow designer ?
And where are you stuck exactly ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-30-2023 11:24 PM
Yes, I am using OOB Succcessfactor Spoke and six staging blank tables are already attached over there. Out of which three tables are coming with relevant data. However, the table "Locations" has been a challenge for me.
Under Retrieve Locations Action, we can find the below OOB script
(function execute(inputs, outputs) {
var util = new SuccessFactorsUtil();
var fullPull = inputs.fullPull;
var date = util.convertDateToUTC(inputs.pull_modified_locations_from);
var filter = '';
var format = 'JSON';
// var expand = 'addressNavDEFLT/stateNav/picklistLabels';
// var resourcePath = 'FOLocation?$format=' + format + '&$expand=' + expand;
var resourcePath = 'FOLocation?$format=' + format;
if (!fullPull || fullPull == 'false') {
try {
if (typeof(date) == 'string' && date.trim() != '') {
filter = "lastModifiedDateTime ge datetimeoffset'" + date + "'";
resourcePath = resourcePath + '&$filter=' + filter;
} else {
throw new Error("When 'Retrieve All Locations' is false, 'Retrieve Locations Modified From' is mandatory");
}
} catch (e) {
throw new Error(e);
}
}
outputs.resource_path = resourcePath;
})(inputs, outputs);
I commented the two lines to shorten the url to obtain the results for required fields.
Please check the output as under, External ID and name is coming up fine but issue is with country value.
I hope I am making sense to get the right results. Please correct me if my approach is wrong.