How to call System Property in UI Action

Abhijit Das7
Tera Expert

Hi Everyone ,

 

I am calling System Property inside UI Action. But whenever I adding system property in UI Action , UI Action stops working - it becomes non clickable.

 

uiaction1.PNG

 

System Property:

sys.PNG

 

Note- Both System Property and UI Action are same scope

 

cc: @Ankur Bawiskar @Pavankumar_1 

 

Thanks in advance

1 ACCEPTED SOLUTION

@Abhijit Das7 

that's correct. you need to have script include if you have to use GlideAjax.

I hope you can create script which uses GlideAjax and the required client callable script include

this link has the sample script; enhance it as per your requirement

How do I access the system property in UI page client script? 

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

View solution in original post

6 REPLIES 6

Ankur Bawiskar
Tera Patron
Tera Patron

@Abhijit Das7 

your UI action is client side and you are using gs.getProperty() which won't work in client side.

gs object works only in server side. so that's the issue

you better use GlideAjax and get the property value from there

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

Hi @Ankur Bawiskar 

 

Can you please give any example. One doubt do I have to write script include for this.

 

Thanks

@Abhijit Das7 

that's correct. you need to have script include if you have to use GlideAjax.

I hope you can create script which uses GlideAjax and the required client callable script include

this link has the sample script; enhance it as per your requirement

How do I access the system property in UI page client script? 

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

Hi @Ankur Bawiskar 

 

UI Action:

glideAjax.PNG

 

Script Include: 

scriptinc.PNG

 

I am getting correct value in alert. But somehow when I am using in other place it is showing undefined.

 

Thanks