Workspace, custom field decorator

Roen
Kilo Expert

Hi,

I am trying to create a custom field decorator.

The decorator should copy the text in the field it is attached to, to the clipboard.

 

How do I create a custom field decorator??

 

I have tried creating a now-cli component that does this, but when I create the decorator and attach it to the field as a UI component, it just does nothing...

find_real_file.png

 

find_real_file.png

 

 

1 ACCEPTED SOLUTION

thank you for the suggestions Drew, it helped me get the motivation to rumage around more to find the issue.

I was able to figure out why a UI component didn't natively work as a field decorator.

 

When you create a field decorator from the menu.

find_real_file.png

It does not set the form position to contextual side bar.

as the UI component MUST be set as a contextual side bar(maybe related item, didn't test this) to be loaded in,

even if it is a field decorator

find_real_file.png

 

I had to go to sys_declarative_action_assignment.list

where I found my decorator missing the form position.

Set it to contextual side bar through the list view, not the form view.

As the form view hides this option.

 

 

View solution in original post

12 REPLIES 12

Tommy Jensen
Giga Guru

How does your properties setup look like in the component?

DrewW
Mega Sage
Mega Sage

Have you review the documentation here?

https://docs.servicenow.com/bundle/orlando-servicenow-platform/page/administer/workspace/task/field-...

Workspace has its own way to add Field Decorators to form fields.

yes, I have read the documentation.

I am able to use the built in field decorators in the workspace, create new ones and duplicate their effects.

Problem here is I am trying to make my own using the now-cli that does not seem to activate when the field decorator is pressed.

Roen
Kilo Expert

properties picks up the value.

But problem is clicking the field decorator doesn't activate the UI component in any way.

the only code in it at the moment is the standard now-cli setup and a console.log statement.

If I use it as a contextual side menu or a related items it works just fine.

but as a field decorator it does nothing.

find_real_file.png