Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Can we achieve Field Placeholder via Dictionary Configuration

Anil9866
Tera Contributor

Hey folks,

can we achieve the field placeholder for a custom or OOB field( any data type) in a table via configurations, more of like via Dictionary. Unlike scripting, using .getControl('field'). 

 

Thanks in advance

3 REPLIES 3

Me Being Mustaq
Tera Guru

Hi @Anil9866 ,

 

No, ServiceNow does not provide a native "placeholder" property for fields (whether OOB or custom) that can be set directly in the Dictionary or via configuration. Placeholders (the faint text inside an empty input box) are UI-only attributes, and ServiceNow exposes them only through client-side scripting 

g_form.getControl('field_name').placeholder = '...'  or by customizing the form layout with UI Policies

 

If it is helpful, please hit the thumbs button please mark the answer as correct based on the impact!!

 

Kind Regards,

Shaik Mohammed Mustaq

 

 

Sarthak Kashyap
Mega Sage

Hi @Anil9866 ,

 

I checked your problem but I didn't find anything to add placeholder by config dictionary, you can use onLoad client script for that and add below code 

 

var field1 = g_form.getControl('fieldNameHere');
field1.placeholder = "YourPlaceHolder";

 

You can add help & hint by config label

SarthakKashyap_0-1764162652241.png

 

Please mark my answer correct and helpful if this works for you

Thanks and Regards,

Sarthak

Ankur Bawiskar
Tera Patron
Tera Patron

@Anil9866 

at dictionary level you can show some icon etc via UI macro by adding this field attribute

ref_contributions=my_custom_icon_macro

But it cannot be added to all the field types

Adding a UI Macro to a Non-reference Field 

You can use Field styles to show color etc which work on list

AnkurBawiskar_1-1764162775056.png

 

💡 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  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader