Variable Editor in Display Form in Workspace does not wokr

SheltonThompson
Tera Contributor

I added a variable editor UI Formatter to a form to display what was originally entered by the requester in a separate view from the default view.

I intended to add this as a different tab using the display form component in the workspace but noticed the UI formatter refuses to display in that component. Works just fine in the normal form component but I want it read/display only.

Is this a bug or did I miss something?

 

Display only form

SheltonThompson_0-1707167876191.png

View outside the workspace:

SheltonThompson_1-1707167925570.png

Using Form component (added a UI policy to make it read only so got there eventually, but not ideal on what I was trying to go for with using the Display Only Form component)

SheltonThompson_2-1707167961833.png

 

1 REPLY 1

garyopela
ServiceNow Employee
ServiceNow Employee

Ahh, I found it. 

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB2199466

 

So, the custom UI Macro has to be in the Global Scope, it won't work if it's in a scoped app. Also, the name of the custom UI Macro MUST start with com_glideapp_servicecatalog_veditor. Then you can add something to the end of it. I think this is why it has to be global, because if it's scoped, then it puts the scope name in front of it. Apparently workspace only works with formatters who call UI Macros that start with com_glideapp_servicecatalog_veditor. So, you'll have a UI Formatter that points to this UI Macro. After you do this, you'll need to remove the variable editor and then re-add it.

 

I tested this, and I thought it didn't work at first. However the crazy thing is that the variable was there. It just didn't look like a variable editor, it looked like a normal field. Pretty slick.