- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2024 12:45 PM - edited 04-20-2024 12:47 PM
Hello everyone,
what do I have to consider if someone wants to send me data to ServiceNow. We want to populate the Location table and the source is SAP. the connection was established successfully.
How can I tell the SAP team in which format the information needs to be provided?
I got this information from the SAP team. What do I have to take into account on the ServiceNow side? It's about the location table.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2024 01:22 AM
Hi @itspezi1 ,
There are few check :
1. As i see from the image you will be getting the information in JSON format, you can consider writing those info in a staging or temp table parse the json and move it from staging to cmn_location table. (This is from the best practice).
2. Avoid Direct updation from SAP source (this may bring in trash data into location table)
3. Make sure the table has no write restriction like ACLs.
4. You must be providing them a REST account with proper role and access which will be used for auth / may be token even. (depends on type of auth used).
Many more based on scenarios... I Hope this info helps you at this moment....
☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2024 01:22 AM
Hi @itspezi1 ,
There are few check :
1. As i see from the image you will be getting the information in JSON format, you can consider writing those info in a staging or temp table parse the json and move it from staging to cmn_location table. (This is from the best practice).
2. Avoid Direct updation from SAP source (this may bring in trash data into location table)
3. Make sure the table has no write restriction like ACLs.
4. You must be providing them a REST account with proper role and access which will be used for auth / may be token even. (depends on type of auth used).
Many more based on scenarios... I Hope this info helps you at this moment....
☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2024 01:48 AM
one last question. Do the fields have to be named the same in the staging table (ServiceNow) as in the example from the SAP team?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2024 01:51 AM
Nope, not necessarily.... You can name it similar to original table fields name so that you can map them easily when your creating a transform maps...
Thanks
☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2024 02:41 AM - edited 04-21-2024 02:42 AM
To use the Import Set API to get data into ServiceNow, you can follow these general steps:
Create an Import Set Table:
- First, create an Import Set table in ServiceNow. Import sets provide a way to import data from various data sources into ServiceNow tables...
Prepare Data for Import:- Ensure that the data you want to import is formatted correctly and meets the requirements of the Import Set table.
- This may involve transforming the data into a compatible format and ensuring that it includes all necessary fields.
Set Up a REST API Endpoint:- Configure a REST API endpoint in ServiceNow that will receive the data.
- You can create a Scripted REST API or use an existing endpoint, depending on your requirements.
Write Script to Process Incoming Data:- Write a script to process the incoming data from the API request.
- This script should parse the incoming data and insert it into the Import Set table.
Use Scripted REST API to Handle Incoming Data:- Use a Scripted REST API to handle the incoming data and trigger the import process.
- This API should call the script you created in the previous step to process the data
Here's a simplified example:
(function process(/*RESTAPIRequest*/ request, /*RESTAPIResponse*/ response) {
var requestBody = request.body.data; // Assuming data is passed in the request body
var importSetGR = new GlideRecord('your_import_set_table');
requestBody.forEach(function(record) {
importSetGR.initialize();
importSetGR.setValue('field1', record.field1);
importSetGR.setValue('field2', record.field2);
// Set other field values...
importSetGR.insert(); // Insert the record into the Import Set table
});
response.setStatus(200);
response.setContentType('application/json');
response.setBody({
'status': 'success',
'message': 'Data imported successfully'
});
})(request, response);
☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....