UI Action workspace script - how to get values from variable fields on workspace form

mattburgess
Tera Expert

Hi 

 

Does anyone know how to access variable fields in Request Item / Catalog Task on Service Operations workspace when checking using a UI Action > Workspace client script 

 

The traditional way of accessing variables doesnt seem to work in workspace.....

 

i.e. Native

 

g_form.getValue('variables.VARIABLE_NAME')

 

Workspace

 

??

 

 

1 ACCEPTED SOLUTION

mattburgess
Tera Expert

Hi - ok so we have figured out that we will need to hide the UI Action button in SOW through UI Action visibility as the logic in native UI Action will not work the same way in Workspace without serious rework (i.e. using GlideAjax to do the logic to check if all variables are filled in etc)

 

Then we are going to create a Declarative Action (DA) to mimic the same behavior in Workspace and set that visible on the SOW form.

 

Thanks for your help.

 

It does seem that reworking complex UI action scripts in SOW is very difficult and therefore using DA to do the same logic for workspace seems the right approach.

 

Agree?

 

 

View solution in original post

12 REPLIES 12

@mattburgess 

Here is the breakdown

1) Close button as UI action works in native view

2) Same Close button as UI action in SOW will work with script written in workspace client script

I didn't get what's not working. If you wish to show some modal then you can use g_modal in workspace client script of that same UI action

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

mattburgess
Tera Expert

Hi - ok so we have figured out that we will need to hide the UI Action button in SOW through UI Action visibility as the logic in native UI Action will not work the same way in Workspace without serious rework (i.e. using GlideAjax to do the logic to check if all variables are filled in etc)

 

Then we are going to create a Declarative Action (DA) to mimic the same behavior in Workspace and set that visible on the SOW form.

 

Thanks for your help.

 

It does seem that reworking complex UI action scripts in SOW is very difficult and therefore using DA to do the same logic for workspace seems the right approach.

 

Agree?

 

 

@mattburgess 

Glad to know.

If my response helped please mark it correct as well so that it benefits future readers.

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