Interested in a ServiceNow event built for developers? Registration for now[dev]26 is officially open!

Dynamically Change Catalog Variable Placeholder/Watermark Based on Another Variable Selection

nameisnani
Giga Sage

Hi Team,

 

I'm working on a Catalog Item and need to dynamically update the placeholder (watermark) text of a variable based on the selected value of another variable.

Variables

Affected Service / Application

  • Backend Name: u_affected_service_application

Report Name or Report Code

  • Backend Name: short_description

Requirement

When the user selects:

AAI Reporting
Show more lines
 

from u_affected_service_application, I want the watermark/placeholder for short_description to display:

 
e.g. CLM 0001 - Operational Motor Report
Show more lines
For all other selections, the watermark should display:
e.g. I Cannot log into Microsoft Teams
 
can any one please provide script 
3 REPLIES 3

Ankur Bawiskar
Tera Patron

@nameisnani 

screenshots please

I don't think placeholder text can be dynamically updated via script, unless you use DOM manipulation

DOM manipulation is not good practice

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader

@Ankur Bawiskar  can u please help me with better aproach with working script 

@nameisnani 

screenshots please

Regards,
Ankur
Certified Technical Architect  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader