Salesforce B2C Commerce JavaScript Expressions in ISML

To simplify coding, we prefer that you use B2C Commerce JavaScript expressions within ISML templates.


This prints the product display name from the Pipeline Dictionary:

<isprint value="${pdict.Product.displayName}"/>

The product SKU is:


This checks if there are any items or gift certificates in the cart (as entered by the customer):

<isif condition="${empty(pdict.CurrentForms.cart.items) && empty(pdict.CurrentForms.cart.giftcerts)}">
<!--- empty basket --->
<div id="infoBox">Your shopping cart is empty.</div>	

The Empty Operator

Empty has a particular significance when accessing an object, as follows:

Operator Purpose

Returns true if the object is empty. Empty is defined as:

  • null
  • undefined
  • a string with zero length
  • an array with no elements
  • a collection with no elements
Note: If the object is never declared, the JavaScript throws a ReferenceError so Empty(object) isn't true.
isEmpty() Returns true if the collection is empty.

Propagates an assertion using the specified message if the specified object is empty.


  • arg - the object to check.
  • msg - the assertion message.