---
schema_version: "1"
id: 8ff78d8392ba870743dff758eb6608f1ed88155dbf7566f009b34925ec4b0595
title: Perform a Triggered Send to a List Using AMPscript and Server-Side JavaScript
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/marketing-cloud/guides/mc-programmatic-content/ssjs_performTriggeredSend.md
canonical_url: https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/ssjs_performTriggeredSend.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 598c252424b78fed5c4bd12d4e3e1477077ca545d145aaa97507e0cd2b61d9a1
products:
  - Marketing Cloud Engagement APIs and Programmatic Languages
  - Marketing Cloud
---
# Perform a Triggered Send to a List Using AMPscript and Server-Side JavaScript

Use this sample code as a model for your own call.

```
%%[
VAR @TSD, @ListID
SET @TSD = "TrigToAList"
]%%
<script runat=server>
    Platform.Load("Core","1");
    var TSD = Variable.GetValue("@TSD");
    var results = TriggeredSend.Retrieve({Property:"CustomerKey",SimpleOperator:"equals",Value:TSD});
    var count = results.length;
    var ListID = results[0].List.ID;

    //Write the result
    Write(Stringify(ListID));

    //Set the Variable to be accessible in AMPscript
    Variable.SetValue("@ListID",Stringify(ListID));
</script>
%%[
SET @PassedInListID = @ListID
]%%
FROM AMPscript ListID = %%=v(@PassedInListID)=%%
```
