How to add tooltip on form section
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2024 05:14 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2024 01:50 AM
Hello @Ap_1,
Please refer to the below link:
https://www.servicenow.com/community/developer-forum/tooltip-for-form-section/m-p/2401240
Mark my correct and helpful, if it is helpful and please hit the thumbs-up button to mark it as the correct solution.
Thanks & Regards,
Abbas Shaik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2024 08:35 AM
Hi @Ap_1
I guess we can do this, firstly, create a new UI Policy under "System UI > UI Policies". Specify the relevant table for your form section and define the conditions under which the tooltip should appear.
Next, create a Client Script of type "OnLoad" to dynamically set the tooltip text on the ur language preference. You can conditionally set the tooltip text accordingly in both English and French.
Apply the UI Policy to the form sections by specifying the condition in the UI Policy configuration.
This is the ex of client script below
(function() {
var tooltipText = '';
var userLanguage = g_lang; // Assuming g_lang contains the user's language preference
if (userLanguage === 'fr') {
tooltipText = 'Texte de l\'info-bulle en français';
} else {
tooltipText = 'Tooltip text in English';
}
g_form.setSectionDisplay('section_name', true, tooltipText); // Replace 'section_name' with your form section name
})();
If this helps kindly accept the answer thanks much.
Regards
Azar
Kind Regards,
Mohamed Azarudeen Z
Developer @ KPMG
Microsoft MVP (AI Services), India