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
6 votes
0 answers
614 views

Using a Shared SSJS functions in my Automation Script Activity

Let me preface this by saying that I am not looking at cloud pages. I am looking to either use Content Blocks or other Activity Scripts to store JS functions which I can load into an Automation Script ...
JordanGS's user avatar
  • 198
0 votes
2 answers
228 views

Create a text-only email programmatically in Marketing Cloud

Hi Marketing Cloud gurus, Does anyone know how to create a text-only email programmatically? I am building an application in a Cloudpage (so users don't have to login into SFMC and the initial step is ...
nerran's user avatar
  • 5
0 votes
1 answer
303 views

Getting an error when trying to use UpsertDE() in SSJS

I am getting an error when I try to upsert into the Data Extension using SSJS. Error says : Unable to retrieve security descriptor for this frame. Here is the same code for which I get error: <...
degi's user avatar
  • 3
0 votes
1 answer
662 views

Unable to Insert Date into Data Extension via SSJS

The Problem I am trying to convert a date-time field that is retrieved from a WSProxy call previously. The date-time is provided to me in the format of YYYY-MM-DDTHH:mm:ss.sss, trying to insert this ...
JordanGS's user avatar
  • 198
1 vote
1 answer
363 views

Data Extension Caching when doing Lookups

Script description: There is a script that aims to retrieve up to 200 records from the Data Extension, perform some manipulation with retrieved values and lastly delete processed records from the ...
Niko's user avatar
  • 2,650
0 votes
1 answer
252 views

Getting error when upserting data extension with SSJS

I am trying to query the contact and another data extension and then upsert a third data extension called customerETL. Everything works if I hardcode values into the function but when I pass values ...
neo2049's user avatar
  • 392
0 votes
0 answers
41 views

How to prevent retrieving Private Lists in Marketing Cloud?

I'm trying to retrieve Subscriber's public lists only, but it keeps returning public lists + a private list called "All Subscribers". I've tried both following methods but neither worked, ...
Simon's user avatar
  • 13
0 votes
1 answer
192 views

Moving over 2000+ old Data Extensions to new folder for review/delete

I am trying to move multiple old DEs into a new folder. And, with my limited experience with SFMC Objects & WSProxy/SSJS, I dug deep into multiple resources & samples codes like (Zuzanna - ...
Araarso's user avatar
  • 23
0 votes
1 answer
298 views

Why does my publication list array return undefined in Vuejs?

I'm learning to build a custom preference centre and trying to display all the lists for a subscriber. I retrieved all the lists like below: <script runat='server' type="text/javascript"&...
Simon's user avatar
  • 13
2 votes
0 answers
176 views

Trying to make API call to external server from SFMC

I'm trying to make API call to external system from a Cloud page, but when I publish I'm getting response Response:nullresultString. Is it something do with IP whitelisting or it's a code error. Below ...
Ramya's user avatar
  • 31
1 vote
1 answer
1k views

How to Make API Call from SFMC Cloud page to External System

I'm trying to make API call to external system from a Cloud page, but when I publish I'm getting response Response:nullresultString:. Below the code details. Can someone please help me this. Thank you ...
Ramya's user avatar
  • 31
0 votes
1 answer
56 views

Unable to retrieve ReplyToAddress & ReplyToDisplayName

I am not able to retrieve ReplyToAddress & ReplyToDisplayName from TriggeredSendDefinition. Currently, I have successfully retrieved FromAddress & FromName from TriggeredSendDefinition using ...
Eliott's user avatar
  • 163
0 votes
1 answer
71 views

FilterDefinition Client IS property missing, Marketing Cloud

I faced strange situation. I am trying to retrieve all Data Filters from the specific Business Unit from salesforce Marketing Cloud. on the marketing cloud SDK help page there is info that ...
Alicja's user avatar
  • 1
0 votes
1 answer
192 views

Testing retrieving Automation Statuses in Batches. Error looping through results

I'm building an automation to retrieve the latest statuses for a number of specified automation instances. The flow is something like run SJSS to retrieve all statuses for the automation instance and ...
JimS's user avatar
  • 113
1 vote
1 answer
71 views

Running a script on row update or addition in marketing cloud

I have a DE in marketing cloud which has fields for marketing permission.The permission should be sent to an external database using an api whenever a new row is added or updated.I have to use server ...
Sandeept's user avatar
0 votes
1 answer
1k views

SSJS date time filter for previous day

I'm having a problem in pulling in only the records with a ModifiedDate from the previous 24 hours from this SSJS filter when trying to access ListSubscribers object. I can use it to find a specific ...
desertliving480's user avatar
0 votes
0 answers
258 views

SFMC - Use image in SFTP in an email

An external platform generates QR images and leaves them in SFMC's SFTP. I want to use these images to insert them into an email. I know that if the image is in a Content Builder folder I can use the ...
Julio Cayulla's user avatar
0 votes
1 answer
231 views

UpdateSingleSalesforceObject - when does it actually return 0 value?

The Salesforce AMPscript function UpdateSingleSalesforceObject returns 0 for failure according to documentation. However, all failures of the function we have simulated (for example: invalid SF id, ...
Barak's user avatar
  • 133
0 votes
2 answers
906 views

Retrieve all Data Extensions across all running journeys

I found out on this forum there is an option with Marketing Cloud API to retrieve all the Data Extensions associated with Journeys. When using Postman, the request below works perfectly GET /...
nerran's user avatar
  • 5
1 vote
1 answer
440 views

Extract Text Version of the email body with no html tags using REST API from SFMC

I was trying to extract the email body (text version) with no html tags from SFMC. But I had some hard timing on how to filter out the nodes in the email content to get the expected result, I couldn't ...
Yesh's user avatar
  • 31
0 votes
0 answers
408 views

Identify Query Activities within Automation using ssjs

I am trying to identify all the activity queries within an automation using ssjs. I came up with the following code but it seems not working rightnow. Have you guys ever had this problem? Did you ...
Steffnu's user avatar
0 votes
1 answer
486 views

How to update salesforce custom object (Customer__c) OptIn field value from Marketing cloud (Customer DE) OptIn attribute value using AMP script

I have a scenario, 1 DE (Customer DE with SubscriberKey, OptIn, Status, OptInDate attributes) with some records. I want to update the salesforce Customer__c object records OptIn (Yes/No) if ...
Venkat's user avatar
  • 13
0 votes
1 answer
490 views

SSJS date time retrieval error

I am trying to retrieve the date-time in SSJS. I have created the below code on the cloud page, to retrieve the locale date time. <script runat="server"> Platform.Load("Core&...
Chandan's user avatar
  • 651
0 votes
0 answers
313 views

SSJS Try/Catch Behaving Different in Different MIDs

For context, I have two different Marketing Cloud orgs, one that we will call PROD and one that we will call UAT. They are completely separate. They are each connected to a Salesforce instance, PROD ...
Zach's user avatar
  • 107
0 votes
2 answers
133 views

Store logs separately generated by logunsub event in a Data Extension. The Response Returned is in HTML and not in JSON format

UnsublogEvent is working as expected. the only thing is I have to pass the response back to the data extension. Response = Platform.Function.InvokeExecute(lue, statusAndRequest); above row gets the ...
pragyanshu kukreti's user avatar
0 votes
1 answer
906 views

SSJS Lookup All Rows from Data Extension Column as Array

So I have a "Master" Data Extension that has a ton of columns and rows (millions), and one column needs to have some changes made for specific rows based on Customer_ID. I have a ...
Eduardo's user avatar
  • 27
0 votes
1 answer
560 views

To get data of all automations created in BU with their status

I tried below code to run in my BU to retrieve records, but it does not publish anything. <head> <style> body, a, input, td, th {font-family:sans-serif; font-size:12px;} </style&...
Drishti Jindal's user avatar
0 votes
0 answers
317 views

SSJS Array.prototype throws jintException when used with DataExtension.Retrieve value of test

I have stumbled across another interesting case with SSJS and Salesforce Marketing Cloud and hope for some ideas on why this occur and furthermore, how I may can prevent this from happening. On a ...
shd.lux's user avatar
  • 466
0 votes
0 answers
123 views

Break ampscript resultset when spaces are found and store them in separate variables

Currently I have script to fetch values from a DE SET @retrieveRequest = CreateObject("RetrieveRequest") SetObjectProperty (@retrieveRequest, "ObjectType", "...
pragyanshu kukreti's user avatar
0 votes
1 answer
478 views

Can I trigger a specific step of automation I want to start ? Using SSJS

I have this code that Start my automation, but I also would like to say what of steps start and finish Like : I just want that step 3 start and finish Follow the code: <script runat="server&...
Marcos Felipe's user avatar
1 vote
1 answer
182 views

Cannot create a Data Extension using SSJS in CloudPage but same code works in Automation Studio

I have created a HTML landing page like below, which takes the input from the user for Data Extension name <html> <body> <h1> Create a new Data Extension </h1> ...
natalie's user avatar
  • 11
0 votes
1 answer
333 views

What is the flow that happens when submitting the form on a cloud page using Axios/ajax?

I am trying to implement the solution given by this website, to start an automation from a cloud page. There are 3 parts of code. HTML page (understood this) form-handler code with SSJS (understood ...
natalie's user avatar
  • 11
0 votes
0 answers
129 views

Issue when creating a Data Extension within shared folder using SSJS

I could create a Data Extension successfully within any folder inside Data Extension parent folder using the below code. But when I do it for Shared Data Extension, I am not successful, could anyone ...
user0151's user avatar
0 votes
0 answers
25 views

SSJS RegExp Are Broken? [duplicate]

The Regular Expressions in SSJS Email Studio seem to be broken or have different results than expected, Is anyone able to shed some light on this discrepancy and how I can work around this? Thank you. ...
user avatar
0 votes
1 answer
719 views

SSJS API call with form-data Content-Type

I am trying to make a request to an external API with SSJS and I have found this post where Eliot Harper posted a solution. I have made a lot of API calls using SSJS but with Content-Type JSON. Now I ...
Ruben's user avatar
  • 31
0 votes
1 answer
184 views

WSProxy Data Extension AddOnly bug

I'm trying the following code: Platform.Load("Core", "1"); var prox = new Script.Util.WSProxy(); function addDE(DEKey) { var updateObject = { ...
Christopher Carswell's user avatar
0 votes
0 answers
65 views

I'm having problems with inserting subscribers in my DE

I want to insert data in my DE, but instead of inserting each subscriber inside a line, it's putting all the text on my page on one line, how do I fix this? The Subscribers that I retrieve in my web ...
murilo frederico's user avatar
1 vote
1 answer
353 views

Code disappears from Cloud Page after saving or publishing in SFMC

I am building a setup to trigger an automation from the cloud page by following this guide - https://ampscript.xyz/how-tos/how-to-start-status-of-automation-from-marketingcloud-form/ When I try to add ...
user0151's user avatar
0 votes
1 answer
416 views

Not able to create an EMAIL MESSAGE using SSJS in Marketing cloud?

I am trying to find a way to create an email with a click from the browser using Javascript client side & server side ( AJAX ), but now having issues with SSJS, I tried to retrieve the id of the ...
TaouBen's user avatar
  • 154
1 vote
1 answer
469 views

How to create a Triggered Send Definition using SSJS?

I want to create a triggered send definition using SFMC SSJS. This should be possible using either the TriggeredSend Platform object's Add method or via WSProxy. However, I can not get either to work....
Denis's user avatar
  • 11
0 votes
1 answer
305 views

Prevent AMPscript from executing in view online link (MC)

I have a process set-up where people can confirm they have received a message via A Cloudpage. If they open the Cloudpage a field in Salesforce is updated saying they have confirmed. On the object in ...
Lex Joosten's user avatar
2 votes
1 answer
244 views

Unable to update Data Extract activity via /automation/v1/dataextracts/{{dataExtractDefId}}

I am facing an issue where I am not able to update the DataExtract (File Convert) activity via Rest below API in SSJS script activity. In the API response I am getting below error API Responsse : {&...
Coder_geek's user avatar
0 votes
0 answers
279 views

Contact delete in Marketing cloud- Which account id we have to use if we have multiple business units in payload

Need a clarification in contact delete by lust reference. We have a parent BU (business unit) at the top of the tree, and one of the other BUs is TEST. In TEST we have created an Installed Package ...
DSK's user avatar
  • 1
0 votes
0 answers
326 views

Cannot delete Content Builder Asset using SSJS

I am trying to delete asset using SSJS (CloudPage) so that we can automate the deletion of unused assets from Content Builder. I could not find SFMC documentation for DELETE method but could see that ...
Sanket kharwade's user avatar
0 votes
1 answer
213 views

Does WSProxy Calls consume SFMC API limits?

We have a use-case where we have to find out all the Data extensions present in a Business unit. We can achieve this by using the WSProxy Retrieve option or SSJS RetrieveRequest approach. As the ...
Sayan Prachanda's user avatar
0 votes
1 answer
111 views

How can we effectively delete bulk records (eg. 50k at a time) in Auto-Suppression List using SSJS?

I wanted to delete bulk records from auto-suppression list, when I deleted 1400 records the following script worked like a charm, but when I delete 90k or 20k records, it only deletes 200 or 300 ...
Vishnu Vardhan A's user avatar
0 votes
1 answer
147 views

ampscript HTTPPost2 equivalent in SSJS [duplicate]

I have a working ampscript to create a subscriber_key SET @url = Concat("https://xxxxx/sk_generator?email=", @email_address) /* Call SK API */ SET @output = HTTPPost2(@url, ...
Johhnytska's user avatar
1 vote
0 answers
571 views

Is there a way to automate (API, SSJS script, etc.) stopping the journey when the last contact exits?

I am currently working on a case where I need to work on automating to stop the journey when the last contact exits it. It would be much easier to just manually stop the journey. However, I need to ...
Hannah Kim's user avatar
-2 votes
1 answer
655 views

Issue in Parsing JSON response using SSJS [closed]

I have a JSON Response that I received after performing a HTTP POST call. { "Status": 0, "Content": "{ \"id\": \"73614a0d-39af-48a3-8b95-...
Rishi Ganesh's user avatar
0 votes
2 answers
237 views

Calling a MC REST API from within a Code Resource Page [closed]

Is it possible to call the Increment Column https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/putIncrementColumnValueByKey.html REST API from within a code resource page using SSJS?...
Ruskers's user avatar

1 2 3
4
5
19