Hey @josephq Eden from the support engineer team here.
Thanks for reaching out. At the moment, it wouldn’t be possible to insert text parameters that automatically populate in the Help Center search bar when programmatically calling Intercom('showSpace', 'help');
, however I can see how that would be cool functionality to have! I’ll submit this as a feature request for you with the product team.
I was searching for something else and came across this, not sure if it’s worth trying but, if you are already procedurally showing help, I would’ve suggested using jQuery or JS to programattically set the help field input after the Intercom agent reached a ready state. ChatGPT says the code might look like this:
// Open the help dialog and set the search field text
Intercom('showSpace', 'help');
// Set the value of the search field to 'Getting started'
Intercom('update', {
custom_launcher_selector: '#intercom-container .intercom-help-center-input', // Change the selector accordingly
custom_launcher_content: 'Getting started',
});
But just be aware of the race condition this introduces. The first command is trying to open and display the dialog, the second is looking for the field in the dialog, but is probably executing before the dialog is ready. If the Intercom function returns a promise, you could do it like this:
// Open the help dialog and set the search field text
Intercom('showSpace', 'help').then(function(){
// Set the value of the search field to 'Getting started'
Intercom('update', {
custom_launcher_selector: '#intercom-container .intercom-help-center-input', // Change the selector accordingly
custom_launcher_content: 'Getting started',
});
});
Otherwise, you’d be left with a clunky setTimeout approach, which if tuned right would work most of the time:
// Open the help dialog and set the search field text
Intercom('showSpace', 'help');
// Introduce a 0.5 second delay using setTimeout
setTimeout(function() {
Intercom('update', {
custom_launcher_selector: '#intercom-container .intercom-help-center-input', // Change the selector accordingly
custom_launcher_content: 'Getting started',
});
}, 500); // 500 milliseconds = 0.5 seconds
Hope that helps!
Bryce R