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
0 votes
2 answers
384 views

delete subscriber from Auto Suppression List using SSJS?

SSJS to delete record from list runs, but no action I am getting similar error however in my case i am trying to delete the email from Auto supression list created in Email Studio Admin page. <...
syed Basha's user avatar
-2 votes
1 answer
393 views

Pass a variable from Javascript to AMP Script or SSJS

Is it possible to pass a variable from Javascript to AMP Script or SSJS? The reason is I need to use Javascript libraries to generate a variable which I need to use in SSJS to make an API call.
Helios.One's user avatar
0 votes
1 answer
327 views

How to batch update DE records using WSProxy?

I was able to update 1 record at a time using this code: var prox = new Script.Util.WSProxy(); var props = [ { "Name": "Contact_Key", "Value&...
yoni349's user avatar
  • 81
0 votes
0 answers
132 views

Not able to retrieve null values from nested JSON array using SSJS For loop

Here's the nested json I'm working with { "Instructions":{ "Instruction":[ { "Type 1":"abc", "Type 2":"...
zahaan's user avatar
  • 1
0 votes
1 answer
73 views

Programatically update the "Used for Sending" value for DEs in folder and all child folders

I'm attempting to update the "Used for sending" value for all DEs in a select folder and include the DEs in all the child folders. I've written the code below that passes valideation, but I ...
Gbengoose Wuru's user avatar
0 votes
1 answer
125 views

Remove duplicates from an array built in SSJS

I'm using SSJS to pull api data and build emails. I have an array built that has some duplicate data in it. I'm looking for anyway to remove the duplicate information. I've tried all the regular JS ...
Jason G's user avatar
1 vote
0 answers
43 views

SFMC - upload contents (as a formatted JSON) to sftp

Let's say we've got <input type="file"> inside a form placed on a cloudpage and posted it using POST with our file contents as a form params to a server side. Is it possible to send ...
pincet's user avatar
  • 839
0 votes
0 answers
83 views

SFMC Lookup is not working after Upsert Data Extension

I am using (SSJS +Ampscript) because i need to create dynamic variables. I am upserting DE using ampscript and trying to look up same record using SSJS Rows.Lookup but still giving the old value not ...
user2733262's user avatar
0 votes
1 answer
301 views

Targeting a nested array with SSJS to use with a for in loop in Marketing Cloud

I've got some nested Json that's using a dictionary with dynamic keys and values - I don't know which key-value pairs will appear in the payload but I need to print them all in an email message. The ...
Antonio De Palma's user avatar
0 votes
1 answer
176 views

Split into different rows using SSJS or Query or whatever

I'm totally lost spliting my dataset. The dataset looks like below. What I want to is split 'Field 3' and build exact like under picture. Is there any way to achieve this requirement? If so, please ...
Dong A Shin's user avatar
-1 votes
1 answer
2k views

How can I count the number of objects in my JSON

In the Marketing Cloud I have an attribute field. In this field a JSON is stored. Like so: [{ "Example1": "XXXXX", "Example2": "XXXXXX", "...
Martijn e's user avatar
  • 145
0 votes
2 answers
139 views

Platform function HTTPPost issue

I am building an API call and I need to use POST. I decided to use 'Platform.Function.HTTPPost'. However, my cloudpage has 'internal server error' when I run the code. var token = ...
JordanB's user avatar
0 votes
1 answer
300 views

Redirect to another page on submit

Hello all I have the below code where it upserts into a DE. I also want to redirect to a new cloud page on clicking submit. The issue is I did find a way to do it by using action="%%=...
GS65's user avatar
  • 127
0 votes
2 answers
252 views

Find emails sent to a specific data extension?

Is there a way in marketing cloud to find what emails were sent to some select DE's? Even if it has to be checked one DE by DE, is there a way? Views doesn't give this info at DE level. This will help ...
PJJD's user avatar
  • 91
0 votes
0 answers
86 views

SSJS Rows.Update not working

I'm facing a problem that I don't know how to fix. Basically I'm trying to get all the contacts inside a custom DE and change their status to "Unsubscribe" in the AllSubscribers. This will ...
Lorenzo Meca's user avatar
0 votes
1 answer
197 views

SSJS Init and Retrieve methods not working

Basically I'm creating a script that retrieves all subscribers from a custom DE and unsubscribe them from the AllSubscribers. This code is going to be used inside a Script Activity which will execute ...
Lorenzo Meca's user avatar
0 votes
1 answer
142 views

SSJS API Call - Unable to retrieve security descriptor for this frame

I have this API call, for shortening a link through API, which I got to work in Postman: I want to make the exact same call from an email in Marketing Cloud, and I'm using this script, which I have ...
Nikolai Hvid's user avatar
0 votes
1 answer
320 views

Deleting big amount of records from a large sendable data extension

I have a big sendable data extension (hundreds of millions records) in marketing cloud that has multiple primary keys. The DE is live, and new records are being written constantly. I need to delete ...
S.Yumi.W's user avatar
0 votes
2 answers
220 views

Run SSJS Activity from External System

I have a script activity in Marketing Cloud that processes data from a Data Extension. The requirement is to run this script and save the results in a DE every day, not at a specific time/hour, but ...
Alex's user avatar
  • 158
0 votes
1 answer
155 views

Does the API call trigger by just Cloudpage preview?

I have a cloud page where I have an SSJS script that triggers the API call. When I preview this page using cloudpage preview, I get an error saying the are errors in the cloud page, although this ...
sfmcuser82919's user avatar
0 votes
1 answer
249 views

How can I create a File Transfer Activity in Automation with File Action is "Move a File From Safehouse" by API/SSJS in Marketing Cloud?

I have an SSJS code script that can create a File Transfer Activity but by default, it's made File Action is "Manage File" so how can I change it to "Move a File From Safehouse". ...
Tung Dang's user avatar
0 votes
0 answers
89 views

Update rows in Data Extension

I need to update multiple rows in my Data Extension as a part of automation, however I receive an error with no specific information what is wrong. <script runat="server" language="...
MrSkover's user avatar
1 vote
1 answer
165 views

Junk Characters || SSJS Fire Entry || The Japanese characters show Junk when stored in DataExtension

I am using a simple SSJS code from here. I have updated the Fire Entry API end point as below. /*=== SFMC REST API === */ var payload = { "ContactKey": Account_ID, ...
Vishal Kumar C V's user avatar
0 votes
1 answer
80 views

Troubleshooting SSJS

<script runat="server"> var email = Attribute.GetValue("email"); var entityKey; var emailMatch; var contactRows = Platform.Function.LookupRows("Contacts", &...
QazWsx's user avatar
  • 3
0 votes
1 answer
111 views

Script to change Publication List status works in CloudPages but not Automation Studio

The following code is supposed to change someone's status in a Publication List to "Active". It works very well when I run it via a CloudPage, but when I put it in an Automation Studio ...
K K's user avatar
  • 185
0 votes
0 answers
122 views

SSJS - Split Data Extension by column data

I have a Data Extension, All_campaigns, that contais: cod_id name status city campaign 1472 Anna Ok Paris Perfum_01 1472 Anna Ok Paris Perfum_02 1472 Anna Ok Paris Perfum_03 1473 Rob Ok New York ...
lucesv's user avatar
  • 1
0 votes
0 answers
20 views

Retrieve more than 2500 records in ssjs [duplicate]

in ssjs data extensions how do I retrieve more than 2500 records?
Matteo Amedeo's user avatar
0 votes
1 answer
76 views

For loop in ssjs not working

why this code is not working? <script runat="server" language="JavaScript"> Platform.Load("Core", "1"); var couponsDE = DataExtension.Init("...
Matteo Amedeo's user avatar
0 votes
1 answer
239 views

Marketing cloud SSJS, where to see debug

Hello guys I have this code: <script runat="server" language="JavaScript"> Platform.Load("Core", "1"); try{ var couponsDE = DataExtension.Init("...
matteo amedeo's user avatar
0 votes
0 answers
141 views

Postman cURL to SSJS, Getting Errors

I'm having trouble with converting Postman cURL to SSJS. My goal is to build a cloudpage to make an API call to an external platform to create records, but somehow my SSJS code does not work. Here is ...
Baran Sen's user avatar
0 votes
0 answers
76 views

Click tracking for links inside a SSJS Script

I are currently having issues with click tracking for certain links in emails. In my email I have a SSJS script that parses the JSON data it get from an MC Personalization triggered campaign and saves ...
jay's user avatar
  • 13
0 votes
1 answer
112 views

Fetching information like login time, checking from Sales cloud in Marketing cloud using SSJS

I was able to use the below code in one environment and I am getting the expected results. When I am trying to run the same (I did modify necessary things like change in DE external key, network ID ...
Roma's user avatar
  • 1
0 votes
1 answer
78 views

SFMC_SSJS : Could we Update\Delete an automation from a different BU?

I am trying to Update\Delete an automation from the parent BU (the automation in question is in a child BU). I have tried with 2 methdos : Method_1 : var api = new Script.Util.WSProxy(); ...
Marouenne belhaj's user avatar
0 votes
0 answers
77 views

Encoding a CSV file from a Cloud Page and passing the value to a 2nd Cloud Page not working as expected

What I am trying to do : I have a cloud page where the user can upload CSV file. When user clicks on the “upload” button the a function called getBase64() is called (please refer the below code). The ...
Tim S's user avatar
  • 1
0 votes
0 answers
523 views

How to upload a file to FTP using SSJS code in marketing cloud?

I am looking out for a way to upload a CSV file to FTP using a SSJS code for one of our usecase. Here is the code that I have, <script runat="server"> Platform.Load("core"...
Tim S's user avatar
  • 1
0 votes
1 answer
150 views

SSJS core functions won't unsubscribe from publication list

I'm trying to create a cloud page that will unsubscribe someone from a publication list if they click the link. I do not want to change their status in All Subscribers, and I don't need to include any ...
K K's user avatar
  • 185
0 votes
1 answer
59 views

How to update Data Extention row without creating a new record

i am very new for marketing cloud and I am having this problem.I have a Data Extention containig a list of Subscribers with their email and subscriber key.I build a form working well, which can post ...
hilmi's user avatar
  • 3
-1 votes
1 answer
179 views

Using UpdateSingleSalesforceObject for multiple records

I've got a Cloudpage with Ampscript that displays record information of a custom object related to a Contact. It displays a particular field as a checkbox, which corresponds with the custom object ...
rhsalesforce's user avatar
0 votes
1 answer
176 views

Is it possible to create an elseif statement with GTL

I have created the following: <script runat="server"> Platform.Load("Core","1"); var json = Attribute.GetValue('adressen'); var jsonObj = Platform.Function....
Martijn e's user avatar
  • 145
0 votes
1 answer
161 views

AMP script for Bit.ly for SMS IS working when checking sms subscriber preview but not when running the journey. No link is returned

Anyone using bit.ly is probably aware of the deprecation of their v3 API. I thought I had bit.ly v4 done and dusted, but when sending it to a test DE I noticed no bit.ly URL was rendered. Expected ...
Tom's user avatar
  • 3
1 vote
2 answers
82 views

Simple select from JSON

I'm sure this is a dumb question, I just can't get it to work and I can't figure out why. I have this JSON: [{"prop1":"250","prop2":"1"},{"prop1":&...
Nikolai Hvid's user avatar
0 votes
1 answer
57 views

Change Link Wrapping Unique Identifier after email has been rendered

To conform with a new law, we now must provide customers the option to view received emails in multiple languages at ease. We have solved this by dynamically generating the content for other languages ...
zeebrunner's user avatar
0 votes
1 answer
66 views

Is there a way to retrieve the Number of the contact that successes JB Acitivity?

I'm trying to retrieve the Number of the contact that successes JB Acitivity via SSJS or SOQL whatever. please check the highlighted part of the image I attached.That's the thing I'm trying to ...
Sujin Hwang's user avatar
0 votes
1 answer
207 views

how to publish the records of a Data Extension in an html table

I am using the following code to retrieve all the records of a data extension: <script runat="server"> Platform.Load('core', '1'); var stagingDE = DataExtension.Init("...
Jefersson Gomez's user avatar
0 votes
0 answers
58 views

Problem with updating DE record via SSJS

When trying to update DE record via SSJS nothing gets updated, but I don't know which step is wrong. Any help would be appreciated. Thanks in advance. Here's the SSJS Code. <script runat = "...
Sujin Hwang's user avatar
0 votes
1 answer
66 views

Is it possible to create an email activity in JB to Upsert data into a data extension?

I must upsert data into a data extension with SSJS and AMPscript before sending a push notification in a JB. The best approach would be to create a custom activity but it will have to be for the ...
user125717's user avatar
0 votes
0 answers
25 views

How can i bring this data from DE stored in a text in into table and rows SFMC [duplicate]

I have this data in Data extension but in a text field. I want to out put this in table format like Months Amount Rate 12\x2d17 MTH' : {'99999.99':'4.250', '249999.99':'4.250', '999999.99':'4.250', '...
ahmed Yaqoob's user avatar
0 votes
0 answers
114 views

How to join DEs using a list of DE names with SSJS in SFMC Automation Studio

SSJS isn't my strong suit, but I'm hoping to use it to accomplish a task. I'm going to use AMPscript syntax to explain what I'm trying to do so I can explain it best. In our campaign object in SF CRM ...
en-rep's user avatar
  • 25
-1 votes
1 answer
97 views

Parse cloud page data into Data extension

I have data on cloud page in this format. It is neither a JSON nor XML that i can easily parse. I basically retrieved this with a HTTP GET and write it on cloud page. My goal is to load this data into ...
ahmed Yaqoob's user avatar
0 votes
1 answer
172 views

Using MC Data Extension to update HTML on Landing Page [closed]

Is it possible to pass HTML code through a Data Extension value to set the HTML for an AmpScript Landing Page?
Austin's user avatar
  • 1

1
2
3 4 5
19