How do I hide fields in a table

WeighedBrass95
Tera Contributor

WeighedBrass95_0-1780669669562.png

I am wanting to hide "is it a travel laptop" until "Yes" is selected in "Is this a laptop". How do I hide the field unless the condition is met?

 

1 ACCEPTED SOLUTION

PoonkodiS
Giga Sage

@WeighedBrass95 

Use a UI Policy. It handles this automatically without code.

  1. Create New: Go to UI Policies and click New.

  2. Table / Catalog Item: Select the table or catalog item where your fields live.

  3. Short description:  Show Travel Laptop field if Laptop is Yes.

  4. Set Condition: Under When to Apply, set: Is this a laptop is Yes.

  5. Save: Right-click the header and click Save.

  6. Add Action: Scroll down to the UI Policy Actions related list and click New.

  7. Set Action:

    • Field name: Is it a travel laptop

    • Visible: True

  8. Submit.

ServiceNow will automatically hide the field if the answer is anything other than "Yes".

View solution in original post

3 REPLIES 3

PoonkodiS
Giga Sage

@WeighedBrass95 

Use a UI Policy. It handles this automatically without code.

  1. Create New: Go to UI Policies and click New.

  2. Table / Catalog Item: Select the table or catalog item where your fields live.

  3. Short description:  Show Travel Laptop field if Laptop is Yes.

  4. Set Condition: Under When to Apply, set: Is this a laptop is Yes.

  5. Save: Right-click the header and click Save.

  6. Add Action: Scroll down to the UI Policy Actions related list and click New.

  7. Set Action:

    • Field name: Is it a travel laptop

    • Visible: True

  8. Submit.

ServiceNow will automatically hide the field if the answer is anything other than "Yes".

This is exactly what I needed. Thank you.

Ankur Bawiskar
Tera Patron

@WeighedBrass95 

this is a simple requirement which you can achieve with either UI policy or onChange client script

where are you stuck?

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