Questions tagged [ssjs]

Server-side JavaScript (SSJS) in the Salesforce Marketing Cloud allows a developer to use JavaScript syntax and proprietary platform libraries for server-side processing.

Filter by
Sorted by
Tagged with
1
vote
2answers
682 views

Trying to trigger an automation from different Business unit using SSJS Activity

I have written the below code and created one test scheduled automation to start the automation. I didn't get any error when i did scheduled/publish the code but my automation is not starting. and i ...
0
votes
0answers
80 views

Update sales cloud object field from cloud page landing page using ampscript

Step1:Code1 I am processing on click of a unsubscribe button with a checkbox. Step 2: Code 2 processing the list for unsubscribing using amp script. Step 3: Code 3 It is updating the object field in ...
1
vote
1answer
129 views

SSJS: read response headers from Script.Util.HttpRequest object in SFMC

We need to retrieve the response headers from an HTTP GET call issued in SSJS with the Script.Util.HttpRequest function. Unfortunately, even though it seems straightforward and the task itself is ...
0
votes
3answers
598 views

Submitting HTML characters to a Data Extension via Landing Page and SSJS

I have tried to push data to data extension through a landing page using SSJS. The form fields contain HTML characters (which will import to the Data Extension fine). I'm getting this error when I ...
1
vote
1answer
451 views

Server Side JavaScript to create a filtered data extension?

The Salesforce documentation provides helpful examples of creating regular data extensions using SSJS, but no example for creating a filtered one. Does anyone have a code sample for creating a ...
1
vote
1answer
667 views

Create a Automation Studio Dashboard on a Marketing Cloud Cloud Page

I Want to Create a dashboard where all Automations and there status in the Account is displayed. old post on the topic I Want to push all Automation object data to a data extension. This can only be ...
1
vote
2answers
142 views

How to Update a Data Extension through another Data Extension?

Hello Salesforce Community, I'm new in Programming (around 6 months with JavaScript and Java) and even more rookie in Marketing Cloud (going to my second week) and I'm exploring a use case for a ...
1
vote
0answers
65 views

How to wait untill UpsertData is done using SSJS?

I'm running a for loop to update some DE records. Since the LookupRows is limited to 2000 records, we sometimes need it to iterate again. Therefore the for loop is in a while loop. Rows are marked in ...
0
votes
0answers
31 views

Help with SSJS Complex Filter

I've been working on the filter below but it does not return any result. Can you guys please tell me what's wrong with my code? Thanks! Goal is to find a record where ClientId_Boxhill = CenterClientID ...
0
votes
1answer
50 views

Creating a new dataextension in a new folder using SSJS

I would like to write a single SSJS script that creates a new folder within the Shared Data Extensions tree, and then creates a new Shared Data Extension inside that folder. I'm able to create the ...
0
votes
1answer
48 views

SSJS replace function does not work?

Im trying to replace special character with null within SSJS. here is what i tried: <script runat="server"> Platform.Load("core","1.1.5"); var ...
0
votes
0answers
47 views

Using SSJS to delete rows from DE's with more than 25 million rows

I have scrolled through these pages but can't seem to find a solution. Here's hoping someone can help me out :) I am using the below SSJS in an Automation to remove rows with IsDeleted = 'True' from a ...
1
vote
1answer
30 views

Send progress of CloudPage back to browser during AJAX request

I'm processing CSV files with a CloudPage. I upload the CSV file, then stringify the array, and send it via AJAX to another page. Previously, I had been doing this row by row so that I could show a ...
4
votes
2answers
3k views

Difference between Amp script or ssjs

what is the main difference between amp script or ssjs in marketing cloud. Can you please give me clear information for amp script or ssjs difference.
4
votes
1answer
252 views

Removing a row from a DE with Ampscript or SSJS in a landing page not working

I am using the below SSJS to remove a row from a data extension. <script runat="server" > Platform.Load("Core","1.1.1"); try { var ...
1
vote
1answer
4k views

Trying to automate contact deletion with SSJS

with the GDPR laws in place, it's important to have the possibility to remove contacts from Marketing Cloud. I'm trying to automate the process with existing tools and am looking for possible ...
1
vote
3answers
2k views

SSJS Retrieve does not work with shared DE

I'm building a function that will retrieve data by certain criteria. However, not a single retrieve function will work with a shared data extension. Lookup Rows works, but not retrieve. Data ...
0
votes
1answer
3k views

Custom subscription preference center interface

Looking for support or best practice developing custom subscriber preference & subscription centers for SFMC. I DON'T want a default SmartCapture form. The intention is for a Cloud Pages hosted ...
0
votes
1answer
63 views

Calling SSJS from inside a Journey?

Does anyone have any clever ways to execute SSJS from within a journey? I have some ideas but would love to hear yours. My use case is to listen for new Salesforce CRM records to be created. When ...
0
votes
1answer
40 views

Unsubscribe the same contact from 2 BUs using different ContactKeys

I'm in a bit of a sticky scenario regarding opt outs and ContactKeys with my current client... We essentially have 3 BUs (we're only sending messages from Child BUs). For each Child BU we are using a ...
0
votes
2answers
58 views

SFMC: SSJS script for retrieving data extension names from a folder and place the DE names in another (target) DE [closed]

We have a requirement to retrieve the list of data extension names or external key values under a folder in SFMC and store them in another (target) data extension. I have tried this option mentioned ...
0
votes
1answer
29 views

Need a specific name/value pair from a JSON response

I'm using SSJS, and I have an API call that returns the following JSON response: {"StatusCode":200,"Response":["{\"id\":\"4623abc695724f0190e369a1c0f71f94\"...
1
vote
1answer
43 views

WSProxy to retrieve TriggeredSendSummary report

We are creating TriggerSend Dashboard Report in Cloud pages. We are able to process it using AMPscript and SOAP API call, but unable to process AMPscript SOAP API response. We have decided to use ...
0
votes
1answer
523 views

How to create content Block in content Builder through ssjs in marketing cloud

I am trying to create content block in content builder using ssjs code but I am getting error, please check below code and how to resolve the issue? <script runat="server"> Platform....
-10
votes
3answers
635 views

How to use trim() function in SSJS using data extension in Marketing Cloud [closed]

How do I use trim() functions in SSJS? Using Data Extensions. Can you please provide some examples? I have a Data Extension, where "Message" is an Attribute. In this Attribute how do I use the trim(...
1
vote
0answers
77 views

SSJS In Custom Activity

We currently have a custom activity used to send SMS, we are wondering if anyone has had any success making Ampscript/SSJS accessible within a custom activity in Journey Builder. The idea here is that ...
0
votes
1answer
80 views

How to hide content block at SF market cloud email

I need to show images that returned from the other endpoint at market cloud email. Sometimes the endpoint can return 3 images, sometimes it return 1 image or no image. I tried to use image block to ...
0
votes
2answers
988 views

AMPScript for loop and SSJS

As the subject says, I would like to use two line of SSJS code in a for loop like in the example: VAR @listAddress, @nameChosen, @Counter, @i, @AddressRow, SET @listAddress = ...
0
votes
1answer
79 views

Continuous Pull in Ampscript, GTL, or SSJS from a JSON file

I am trying to find the best method in a Marketing Cloud email to continuously pull data from a JSON file that updates every 5 seconds so that it is "Live" Data within the email. Currently I ...
1
vote
1answer
282 views

Using SSJS in journey builder?

I had heard that SSJS activities could be used in Journey Builder if Script activities are enabled within Email studio? Is this true? is there anyway to use SSJS within Journey Builder without ...
0
votes
1answer
51 views

Overwrite Rows in Data Extension using Script Activity and SSJS

I've been working for about two years within Salesforce Marketing Cloud, but haven't had the need to utilize anything outside of AMPScript, HTML, and CSS as I mostly just build and deploy emails with ...
0
votes
1answer
46 views

How to refer Javascript cloud page in my email in content builder?

I have a Javascript file written and saved in Cloud Page. Now,I want to refer this Javascript file from Cloud page inside my email in Content Builder. The reason why I am following this approach is ...
0
votes
1answer
44 views

SSJS DataExtension.Add Syntax for Decimal Fields

I need to create a data extension using javascript that includes DECIMAL fields. Here's my code that wasn't working. var deObj = { "CustomerKey" : "Genesis_DE", &...
0
votes
0answers
171 views

API ERROR: No HTTP resource was found that matches the request URI

I'm attempting to make a call to an external API using basic authentication and I'm getting the following error: {"Message":"No HTTP resource was found that matches the request URI '...
1
vote
2answers
87 views

How to Page through Data Extension

We have a data extension containing two columns: subscriber_key (email address) url_link We load up this data extension with new subscribers and then iterate through and update the url_link using ...
2
votes
3answers
860 views

Retrieve Data Extension rows using WSProxy

I just learned how to use WSProxy as an alternative to use in Salesforce Marketing cloud. The SF documentation provides retrieve data but is only limited in retrieving data extension schema and ...
0
votes
0answers
50 views

ERROR: Client, ShortCode, Keyword combination is invalid. - using QueueMO with REST API

EDIT: It appears that when the messageText is changed to a specific keyword on the account, it works. But what if I want to send a text with varying message content? I'm trying to make a QueueMO REST ...
4
votes
3answers
6k views

Using AMPscript with SSJS Activities

I have tried using the below AMPscript block in an SSJS Activity, however it appears that Script activities only support SSJS and AMPscript cannot be included in Script Activities — please can someone ...
1
vote
1answer
746 views

Pulling Subscriber Status from Lists using SSJS

I am looking to pull the status of a subscriber whenever they click on the profile center URL link within emails. I have created a custom profile center that pulls all of the lists that I have created ...
0
votes
1answer
46 views

SSJS is not triggering Automation

I am using below SSJS to trigger another automation. I don't see any error, it's completing the task successfully but the next automation is not automatically triggering. Can you please look at it and ...
0
votes
1answer
94 views

How to batch delete more than 2500 records (based on data extension)

I'm looking to remove refunded transactions from the master transaction table (they have two ID where they join on) so that we don't email people about their transactions when they have already ...
0
votes
1answer
64 views

Retrieve Triggered Send Definition Properties

I am referring to the help document to retrieve triggered send definition object. I explore on the landing page but it's not displaying any value. Ideally, it should work as its working for ...
0
votes
1answer
40 views

SSJS to Publish values in Email from DE

I am using below code in email to select all rows from non sendable DE and print them in email. <script runat="server"> Platform.Load("Core","1"); try { //initiate ...
1
vote
1answer
51 views

Obtain publishedURL via WSProxy

I'm trying to obtain the publishedUrl of every CloudPage published. With this script: <script runat="server"> // Load the Core Library Platform.Load("core", "...
0
votes
0answers
48 views

MC Payload creation using variable to invoke REST API

We want to invoke MC Campaign Creation API from SSJS. Campaign data to be created in MC we are fetching from external data source. While creating Campaign REST API Payload to invoke MC API from SSJS, ...
0
votes
1answer
28 views

Display email name associated with a TriggeredSendDefinition via WSProxy on a Cloud Page

I want to retrieve the email name associated with a triggered send definition via WSProxy on a Cloud Page. To be clear, I'm not trying to retrieve the name of the Triggered Send Definition, rather the ...
0
votes
0answers
86 views

How to change Marketing Cloud Http Request timeout?

Is there a way to change MC Http Request timeout? I think that the default is 30 seconds, but the process we are POSTing to via a form can take more. I'm using SSJS for the call: var result = HTTP....
0
votes
1answer
88 views

Updating Publication List from DE using SSJS

I am not an expert in SSJS. But after going through various posts I come up with the below code. I trying to create code in which I am reading data from DE and adding subscribers into Publication List....
0
votes
1answer
41 views

API Rest to remove records from a data extension [closed]

I know it can be done with AMPscript or SSJS, but I need to do with a REST API call.
1
vote
2answers
209 views

Pass values using SSJS and AMPscript on email

Firstly, I apologise - I am a beginner with JavaScript and SSJS. I am trying to send an email with a CTA button that has an url to an external page, which will prepopulate values from a DE on the form....

1
2
3 4 5
14