Client Side Messages i18N.format

Jon23
Mega Sage

I am trying to use i18.format method in a catalog client script but having no luck.  

 

Initially trying the example in the documentation and outputting an alert message using a Catalog onChange script:

 

 

 

var info_message = nowapi.g_i18n.format("The {p1} {p2} {p3} was very very {p1}",{p1: "rich", p2: "young", p3: "ruler"});
alert(info_message);

 

 

 
Console log shows 'nowapi is not defined'.
 
Where am i going wrong?
1 ACCEPTED SOLUTION

Jim Coyne
Kilo Patron

The documentation does not specify, but it seems like it only works in the fulfiller UI forms view only, and NOT in the Service Catalog nor the Service Portals.

 

"Normal" form view:

JimCoyne_0-1694035735712.png

 

Catalog Item in Fulfiller view:

JimCoyne_2-1694035815279.png

(throws error in the browser console)

 


Catalog Item in a Service Portal:

JimCoyne_4-1694035879435.png

 

I could only find the function used in 5 oob Client Scripts.  I only use it in 1 of my UI Actions ("Set Name from Source Table" Tool).  Kinda limiting.

 

View solution in original post

1 REPLY 1

Jim Coyne
Kilo Patron

The documentation does not specify, but it seems like it only works in the fulfiller UI forms view only, and NOT in the Service Catalog nor the Service Portals.

 

"Normal" form view:

JimCoyne_0-1694035735712.png

 

Catalog Item in Fulfiller view:

JimCoyne_2-1694035815279.png

(throws error in the browser console)

 


Catalog Item in a Service Portal:

JimCoyne_4-1694035879435.png

 

I could only find the function used in 5 oob Client Scripts.  I only use it in 1 of my UI Actions ("Set Name from Source Table" Tool).  Kinda limiting.