Can we change Section Name Dynamically?

kumarsatyam
Tera Expert

Dear SNOWers,

I have a requirement on which My Section Name would be changed by Default . Form is normal like Incident form.

I got some solutions but it not worked. EX : document.getElementsByClassName('navbar-title-caption')[0].innerHTML = "newsectioname"

Kindly provide some best and authentic solutions.

pradeepksharma vinitha david-smith ctomasi balajireddy Discuss

Regards Kumar

1 ACCEPTED SOLUTION

I mean the UI page stuff. Please create a fresh thread and I am happy to help.


Ok, I will consider this code.



Thank You,



Vinithabanu Kaliamurthi| Senior Application Software Developer | CDM Smith | Tel: (617) 452-7705 | e-mail: vinithabanuk@cdmsmith.com<mailto:vinithabanuk@cdmsmith.com>


View solution in original post

11 REPLIES 11

snehabinani26
Tera Guru

Check the comments on this SNCGuru post. There's a script you can use there. You just have to tell it the current label of the form section and the ID of the form section on the page.



http://www.servicenowguru.com/system-ui/ui-scripts-system-ui/modifying-label-form-fields-client-scri...


shloke04
Kilo Patron

Hi,



You need to use DOM manipulation for achieving the same.Have implemented a similar functionality for dynamically changing the Container Name based on different choice Value of a Variable. If you want to do this on a form, you can give a try writing an On change Client Script on the field on which you want to change the Value to as per the script below:



Script:



  var x = document.getElementById("Mention Element ID");


  x.querySelector(".form_header").textContent = "New Section Name";



You can also check the below thread and response from Mark on the same:



To change Form Section label dynamically



Hope this helps.Mark the answer as correct/helpful based on impact.



Regards,


Shloke


Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

How can i know the Element id of particular section . In Browser source i was unable to find it .