Dynamic Field label change based on Form / List Views on Workspace

User664605
Mega Guru

Hi Community Experts

We have a requirement where different views are being followed on a Table:
Form/List in both Native/ Workspace
Eg - Audit Engagement form will be holding View A/ View B/ etc. based on Groups on Audit Workspace

 

Here, the ask is to show the Field "Engagement Lead" as Audit Lead for View A and Inspection Lead for View B on Audit Workspace

As per my knowledge, we are able to use getView() to control g_form.setLabel() in NATIVE UI. But have not been able to reach any conclusion in WORKSPACE.

Although we have Workspace View Rules to apply different UI Views for Workspace YET

"Is it possible to have extract the View applied and set Dynamic Labels based on the view applied on Workspace?"

Kindly share the various possibilities for the above scenario.
Thanks in advance.

 

Best Regards,

Sameekshya

2 REPLIES 2

Ankur Bawiskar
Tera Patron

@User664605 

you can change field label in native but not in workspace

that method doesn't work in workspace so your requirement is not feasible

💡 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

-O-
Kilo Patron

In order to run separate logic based on view, you have the option to uncheck option "Global" and enter into field "View" the specific view where the script should be executed.
As for changing the label of a field, one would use method setLabelOf, not setLabel.
a.png

 

b.png