Expand my Community achievements bar.

Submissions are now open for the 2026 Adobe Experience Maker Awards.
SOLVED

Error in fetching Data Source - Service Now

Avatar

Level 6

I created the FDM using service now configuration, while try to open the fdm got the error like "Error in fetching Data Source". Please let me know if i need to change anything.

aravindS_0-1750167058009.png

 

1 Accepted Solution

Avatar

Correct answer by
Level 6

Still the above issue exists, but i have wrote custom java code to connect with Service Now using Authentication. Used the below code. Same way i wrote a custom code (servlet Snow side they will trigger) to consume the incident payload.

 

CredentialsProvider provider = new BasicCredentialsProvider();
provider.setCredentials(AuthScope.ANY, new UsernamePasswordCredentials(username, password));
CloseableHttpClient client = HttpClients.custom().setDefaultCredentialsProvider(provider).build();

HttpPost post = new HttpPost(instanceUrl + attachmentApi + params);
post.setHeader("Accept", "application/json");

MultipartEntityBuilder builder = MultipartEntityBuilder.create();
builder.setMode(HttpMultipartMode.BROWSER_COMPATIBLE);
builder.addBinaryBody("file", pdfFile, ContentType.APPLICATION_OCTET_STREAM, case_transactionID);

post.setEntity(builder.build());

HttpResponse response = client.execute(post);
logger.info("Client response for attachment api {}", response);
client.close();

View solution in original post

3 Replies

Avatar

Employee

Hi @aravindS,

From the initial look, it looks like a configuration issue. Can you please validate the below configurations:

1. Service Now Configurations

  • Please verify that the base URL is correct.
  • Please verify that you have a valid username/password. Also please make sure the credentials are not expired or blocked.

2. Authentication Issues

  • If you're using Basic Authentication, test it separately using tools like Postman.
  • If you're using OAuth 2.0, verify the token endpoint, client ID/secret, and scope.
  • A misconfigured or expired token can cause this failure.

3. Network Issue

  • Please check if the AEM server has network access to the ServiceNow instance. Can AEM resolve DNS and make HTTPS calls to ServiceNow

Lastly if you still see the issue please share the error logs for us to review the information and proceed further.

Thanks
Pranay

 

Official Documentaion: https://experienceleague.adobe.com/en/docs/experience-manager-learn/forms/some-useful-integrations/s...

Avatar

Level 6

Hi @Pranay_M ,

Thanks for your reply, below are the cases which i have tested the connection

Case 1: Used Basic Auth, tested in Postman for get and put both methods works fine there. But in AEM getting the error.

Case 2: Used OAuth 2.0 added the required params like auth url, token url, refreash url, client id and client secret. But got the error while doing the test connection.

Cross checked all the parameter, because all that tested in Postman.

 

Please let me know do i need to add any more configuration. (Likewise we add for MySQL JDBC pooled).

 

Thanks.

Avatar

Correct answer by
Level 6

Still the above issue exists, but i have wrote custom java code to connect with Service Now using Authentication. Used the below code. Same way i wrote a custom code (servlet Snow side they will trigger) to consume the incident payload.

 

CredentialsProvider provider = new BasicCredentialsProvider();
provider.setCredentials(AuthScope.ANY, new UsernamePasswordCredentials(username, password));
CloseableHttpClient client = HttpClients.custom().setDefaultCredentialsProvider(provider).build();

HttpPost post = new HttpPost(instanceUrl + attachmentApi + params);
post.setHeader("Accept", "application/json");

MultipartEntityBuilder builder = MultipartEntityBuilder.create();
builder.setMode(HttpMultipartMode.BROWSER_COMPATIBLE);
builder.addBinaryBody("file", pdfFile, ContentType.APPLICATION_OCTET_STREAM, case_transactionID);

post.setEntity(builder.build());

HttpResponse response = client.execute(post);
logger.info("Client response for attachment api {}", response);
client.close();