Need suggestion on how to pull incident status using adobe launch | Community
Skip to main content
Level 2
February 18, 2025
Solved

Need suggestion on how to pull incident status using adobe launch

  • February 18, 2025
  • 3 replies
  • 1552 views

Hi Team,

 

I need suggestions on how to retrieve the incident status from the Salesforce API using Adobe Launch. 
What would be the best approach to achieve this? 
is there an alternative method that integrates well with Adobe Launch? 
Let me know if you want any refinements!

 

Best answer by Amruthesh_AG

After reviewing the post https://experienceleaguecommunities.adobe.com/t5/adobe-analytics-questions/how-to-integrate-salesforce-with-adobe-analytics/m-p/278675 I got some insights to write some custom code as below.

Add this code through adobe launch as a custom code.

 

const authTokenUrl = "{{end point url}}/services/oauth2/token?grant_type=password&client_id={{Pass the client id here}}.&client_secret={{Pass the client secret here}}&username={{Pass the API username here}}&password={{Pass the API username password}}";
const apiUrl = "{{sandbox url}}/services/data/v50.0/query?q=SELECT Id,Lead_Email,Status, Description FROM Case WHERE Lead_Email='{{Pass the logged in user name here}}'";

// Step 1: Get the Auth Token (GET request)
fetch(`${authTokenUrl}`, {
method: "POST",
})
.then(response => {
return response.json()
}).then(authResp => {
let access_token = authResp.access_token;
fetch(apiUrl,{
method: "GET",
headers: {
"Authorization" : "Bearer "+access_token }
}).then(response1 => {
return response1.json()
}).then(result => {
console.log(result);})})

 

3 replies

Jennifer_Dungan
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
February 19, 2025

This is very similar to your other post https://experienceleaguecommunities.adobe.com/t5/adobe-analytics-questions/need-suggestion-on-how-to-pull-salesforce-data-to-adobe/td-p/737727, and would again require a custom code solution to call the Salesforce API to collect data into Adobe Analytics.

Amruthesh_AG
Community Advisor
Community Advisor
February 19, 2025

Hi @som05 Adobe Analytics don't have any extension or native integration to fetch the data from Salesforce.

You have to write a custom script to fetch the incident status.

Amruthesh_AG
Community Advisor
Amruthesh_AGCommunity AdvisorAccepted solution
Community Advisor
February 19, 2025

After reviewing the post https://experienceleaguecommunities.adobe.com/t5/adobe-analytics-questions/how-to-integrate-salesforce-with-adobe-analytics/m-p/278675 I got some insights to write some custom code as below.

Add this code through adobe launch as a custom code.

 

const authTokenUrl = "{{end point url}}/services/oauth2/token?grant_type=password&client_id={{Pass the client id here}}.&client_secret={{Pass the client secret here}}&username={{Pass the API username here}}&password={{Pass the API username password}}";
const apiUrl = "{{sandbox url}}/services/data/v50.0/query?q=SELECT Id,Lead_Email,Status, Description FROM Case WHERE Lead_Email='{{Pass the logged in user name here}}'";

// Step 1: Get the Auth Token (GET request)
fetch(`${authTokenUrl}`, {
method: "POST",
})
.then(response => {
return response.json()
}).then(authResp => {
let access_token = authResp.access_token;
fetch(apiUrl,{
method: "GET",
headers: {
"Authorization" : "Bearer "+access_token }
}).then(response1 => {
return response1.json()
}).then(result => {
console.log(result);})})

 

Som05Author
Level 2
February 19, 2025

@amruthesh_ag @jennifer_dungan how to fetch logged in visitor user name? Any input would be appreciate.

Amruthesh_AG
Community Advisor
Community Advisor
February 19, 2025

@som05  connect with site developer and check is it storing somewhere on the site if not ask them it pass it as javascript object so that you can fetch dynamically.