---
schema_version: "1"
id: 25adb7a146eb607c332dad4afdf17ddf8aa00b7bab1cc1c5cdae06d02d7514e9
title: isscript Element
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/commerce-cloud/b2c-commerce/guides/isml/b2c-isscript.md
canonical_url: https://developer.salesforce.com/docs/commerce/pwa-kit-managed-runtime/guide/b2c-isscript.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 75950da913e1bd3acb7f785f5eaaaa0dcac9a8f10d33c5861e73d1ea73c74452
products:
  - Composable Storefront
  - Salesforce APIs
---
# isscript Element

Support server-side scripts for scriptlets and inline script expressions, using `${ }`syntax.

## Syntax

```
<isscript>
  ...
</isscript>
```

## Purpose

The script expressions are supported everywhere expressions are supported, including in tags and inline.

These are the top-level variables available to scriptlets:

| Variable | Description                                          | See Also                     |
| -------- | ---------------------------------------------------- | ---------------------------- |
| session  | The current internal Salesforce B2C Commerce session | dw.system.Session            |
| request  | The current internal B2C Commerce request            | dw.system.Request            |
| pdict    | The current Pipeline Dictionary                      | dw.system.PipelineDictionary |
| out      | PrintWriter for the HTML page                        | dw.io.Printwriter            |

Variables set in the template script context are one of two types with respect to their scope:

| Variable   | Scope                                                                                                                                                                                                                                                                                             |
| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Page scope | These are either well-known variables set by the template at run time or those defined in the scriptlet. Variables of this scope are available, once set, through template execution context and can be referenced from multiple scriptlets or expressions in the template or its local includes. |
| Tag scope  | Variables of this type are defined within certain tags. For example, `<isloop... status="safe"/>` defines variable safe of type. Tag scoped variables are available, once declared, in the tag context only.                                                                                      |

## Example

```

<isscript>
        var user = pdict.User;
	  var fullName = user.firstName + " " + user.lastName;
</isscript>

```

Multiple script snippets in one file share the same execution context:

```

<isscript>
        var user = pdict.User;
</isscript>
...
<isscript>
	var fullName = user.firstName + " " + user.lastName;
</isscript>
<isprint value="${fullName}" />

```
