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
0answers
10 views

AMPScript: Can I cast a value as a variable?

I'm doing a lookup of a data extension and bringing a name-value pair back in my code. Is there a means of casting the result as a variable name? FOR @preferencePageIndex = 1 TO RowCount(@...
0
votes
0answers
9 views

Not so public cloud pages in Marketing Cloud

I am building a cloudpage but want to restrict it to be visible only within my company network. I have a solution and it is working. I created a DE with the list of accepted IP ranges and used SSJS ...
-4
votes
0answers
33 views

How can we create a automation using SSJS from Landing page? [closed]

I need to create and schedule an Automation using SSJS from Landing page? Can we create activities using SSJS? Thanks in Advance I tried for status getting values from -1 to 8 code : <script runat=&...
4
votes
3answers
3k views

Server-side JavaScript and JSON

I would like to extract the data from a Data Extension column and parse it as JSON and use the data as attributes in an email. How would I go about doing this? Is there a combination of AMPScript ...
-1
votes
1answer
23 views

Is there a best practice for the number of script activities in an automation?

I'm creating an automation that may need to have upwards of 20 script activities, in order to process 40,000+ records as there's a governor limit of 2500 in Rows.Retrieve. What's the best practice ...
2
votes
1answer
1k views

Making SOAP Calls via SSJS

I am trying to make a SOAP call following from the answer here : Server-Side Javascript calling SOAP API I am running this on a cloud page. When I publish it, it doesnt render (harbinger or bad ...
1
vote
1answer
2k views

Server-Side Javascript calling SOAP API

Does anyone see why this SOAP Request would return a 500 Internal Server Error? If I just pull out the payload test and run it in SOAP UI I get a correct response? <script language="javascript" ...
1
vote
1answer
582 views

Create automation by SSJS

Is it possible to create an automation by SSJS, object type CreateRequest does not exist and I don't know how create that entity in my system. I using this code but last lines gives me an error. <...
2
votes
1answer
30 views

WSProxy - is it possible to move categories / automations?

With the new year I am trying to create a fresh start by cleaning up old folders and files from our MID. It's quite a tedious job to move folders and files manually within automation studio. I am ...
0
votes
1answer
21 views

Retrieve status of automations of all child BUs from enterprise BU

Below is the code which I tried, but when the automation is erroring out the status is populating as paused, scheduled, stopped. The error status is not population. Code: <style> body, a, ...
0
votes
1answer
47 views

Lookup with SSJS in Marketing Cloud

<script runat="server"> Platform.Load("core","1.1.5"); var str = Attribute.GetValue('Test_JSON'); var obj = Platform.Function.ParseJSON(str); var val = ...
0
votes
2answers
38 views

SSJS unable to Parse JSON using the Platform Script.Util.HttpRequest

For a cloud page, I have a use case, where using the Script.Util.HttpRequest/Response I get the OAuth token. Then I have another request, the response structure of which looks like below: { "...
0
votes
1answer
44 views

Send data from one CloudPage to Another

I have a cloudpage that register some customer infos(Fname, Lname, Id...), and theses info needs to be transferred to another CloudPage in order to display the correct Content for that Customer, I'm ...
0
votes
0answers
28 views

Deletes rows in a data extension Error SSJS

Can someone please help me? I want to delete data from Data Extensions, and I tried different variations. But unfortunately, it didn't work. For info I have so far used variant 1 without any problems. ...
0
votes
0answers
35 views

Need help in getting notification for Paused triggered sends

<script runat=server> Platform.Load("Core","1.1.1"); var mid = 'myorgMid'; var dev = 0; var allTriggers = 1; var alertEmailAddress = 'myemailId'; var ...
0
votes
1answer
36 views

User is not unsubscribing when having + in the email

Facing an issue, I noticed some cases where users are unable to unsubscribe if they have a + symbol in the email address. Example - abc+cd@gmail.com Does anyone have the same issue before? any idea ...
0
votes
2answers
2k views

Calling external SSJS in Script Activity

I am attempting to call an external microsite page (content type is text/javascript) in a Script activity. This external javascript contains functions to be used in multiple SSJS scripts. edit: I ...
0
votes
1answer
55 views

SSJS Error on HTTP.Post

I'm facing an issue on sending an HTTP post request from Marketing cloud to ElasticSearch using SSJS. The aim is to send some import statistics of flat files to ElasticSearch in order to retrieve it ...
0
votes
2answers
78 views

How to create dateadd function in SSJS by calling dateadd in ampscript

I'm trying to create a dateAdd function in SSJS by calling the dateAdd function in Ampscript. The code below works. But I cannot figure out how to make the date argument dynamic. This means the ...
0
votes
1answer
55 views

How to find attribute name with the highest value from a Data Extension?

I have those attributes with number type in a DE and want to get the attribute name with the highest value from a record. This following code is what I'm trying to do that purpose, the code didn't get ...
0
votes
0answers
57 views

SSJS failed to process 500K records

The script activity is getting timeout while processing 500K records. I have 2 data extensions. First data extension: Contains the 10 programs mapped to each account numbers. Account number is primary ...
0
votes
1answer
261 views

Triggered send status queued, need to get an alert

I have tried try catch block in my email template to get the error handled and then in catch block trying to do a triggered send activity to send email to the admin, but this is not working. Is there ...
1
vote
0answers
33 views

Retrieve Business Units and add to data extension SSJS

I have the following SSJS function which uses WSProxy to return an array of all business units, however, when I test the script in a CloudPage, it returns an error. I'm hoping someone can take a look ...
0
votes
0answers
20 views

Retrieve User Roles or Permissions in other BUs using SSJS

I have a few users that have access to different BUs. In each BU, they have different Roles (Permissions and PermissionSets), and I'm trying to get those Permissions/Roles that each user has in each ...
0
votes
1answer
26 views

Can't display child elements of ParseJSON in SSJS

I'm trying to extract data and present it in a readable format (testing this out with a public API) <script runat="server"> Platform.Load("Core","1.1.5"); var ...
1
vote
1answer
288 views

Marketing cloud Contact deletion using ssjs

I am new to marketing cloud, can anyone tell me how to automate contactdeletion process using new OAuth 2.0. Using legacy the process works but not able to proceed with OAuth 2.0. <script runat="...
0
votes
1answer
39 views

Skip over bad records in SSJS loop and continue processing

I have created this SSJS Loop, but it will stop when a record is considered "bad". How do I skip over this record to continue the process? <script runat="server"> Platform....
1
vote
1answer
24 views

Rows retrieve is not working as expected in Cloudpage

I have a DE named mock_data_only and its external key is set to the same string. I've tried doing a (SSJS) rows retrieve on this DE and wasn't able to do so. In cloudpage preview there's just a ...
0
votes
0answers
23 views

Is there any way to force a Connector synchronization of an object via SSJS?

I couldn't find anywhere in the API documentation, but is there a way to, via SSJS, force an entity synchronization on an object (Connector)? The issue I'm running into is I created an automation ...
0
votes
1answer
50 views

Bulk delete rows from Data Extension using WSProxy

I am looking to delete rows from "ProxyTest22" data extension and trying to achieve this through WSProxy as the number of rows are in millions. I keep getting Error executing delete call.\r\...
0
votes
0answers
20 views

Import Crypto JS Libraires, Generate Encrypted one and update to DE [duplicate]

Use-case: After FB leads insert into DE, i have to do a encryption on the email address and update the DE to one of the field, I have to use base64encode, HMACSHA256. i am able to retiever records(...
0
votes
1answer
39 views

How to retrieve content block in SSJS

I'm trying to retrieve a content block for a script in ssjs. I tried already several functions but it seems not working. The scope is with a script to retrieve a content from a content area and push ...
-3
votes
1answer
28 views

Populate output of all values in the loop in SSJS

I have the following code and I would like to get all the values in that loop as output. Can someone tell me the function/process we use to get that result? <script runat="server"> ...
1
vote
2answers
633 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
53 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
89 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
563 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
445 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
600 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
97 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
41 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
29 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
44 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
38 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
40 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
27 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
227 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 ...
0
votes
1answer
3k 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 ...

1
2 3 4 5
13